public function generateAlteredMeta()
    {
        //get unmanaged converted to managed
        $managed = array_intersect(
            $this->oldUnmanagedKeys,
            $this->newModelKeys
        );

        //get managed converted to unmanaged
        $unmanaged = array_intersect(
            $this->oldModelKeys,
            $this->newUnmanagedKeys
        );

        $modelsToCheck = array_merge(
            $this->keptProxyKeys,
            $this->keptUnmanagedKeys,
            $managed,
            $unmanaged
        );

        $modelsToCheck = array_unique($modelsToCheck);

        /* @var $oldState ModelState */
        /* @var $newState ModelState */
        foreach ($modelsToCheck as $modelName) {
            $oldModelName = $this->getOldModelName($modelName);
            $oldState = $this->fromState->getModelState($oldModelName);
            $newState = $this->toState->getModelState($modelName);

            $oldMeta = [];

            if ($oldState->getMeta()) {
                foreach ($oldState->getMeta() as $name => $opt) {
                    if (AlterModelMeta::isAlterableOption($name)) {
                        $oldMeta[$name] = $opt;
                    }
                }
            }

            $newMeta = [];
            if ($newState->getMeta()) {
                foreach ($newState->getMeta() as $name => $opt) {
                    if (AlterModelMeta::isAlterableOption($name)) {
                        $newMeta[$name] = $opt;
                    }
                }
            }

            if ($oldMeta !== $newMeta) {
                $this->addOperation(
                    $newMeta->getAppName(),
                    AlterModelMeta::createObject(
                        [
                            'name' => $modelName,
                            'meta' => $newMeta,
                        ]
                    )
                );
            }
        }
    }
public function generateAlteredMeta()
    {
        //get unmanaged converted to managed
        $managed = array_intersect(
            $this->oldUnmanagedKeys,
            $this->newModelKeys
        );

        //get managed converted to unmanaged
        $unmanaged = array_intersect(
            $this->oldModelKeys,
            $this->newUnmanagedKeys
        );

        $modelsToCheck = array_merge(
            $this->keptProxyKeys,
            $this->keptUnmanagedKeys,
            $managed,
            $unmanaged
        );

        $modelsToCheck = array_unique($modelsToCheck);

        /* @var $oldState ModelState */
        /* @var $newState ModelState */
        foreach ($modelsToCheck as $modelName) {
            $oldModelName = $this->getOldModelName($modelName);
            $oldState = $this->fromState->getModelState($oldModelName);
            $newState = $this->toState->getModelState($modelName);

            $oldMeta = [];

            if ($oldState->getMeta()) {
                foreach ($oldState->getMeta() as $name => $opt) {
                    if (AlterModelMeta::isAlterableOption($name)) {
                        $oldMeta[$name] = $opt;
                    }
                }
            }

            $newMeta = [];
            if ($newState->getMeta()) {
                foreach ($newState->getMeta() as $name => $opt) {
                    if (AlterModelMeta::isAlterableOption($name)) {
                        $newMeta[$name] = $opt;
                    }
                }
            }

            if ($oldMeta !== $newMeta) {
                $this->addOperation(
                    $newMeta->getAppName(),
                    AlterModelMeta::createObject(
                        [
                            'name' => $modelName,
                            'meta' => $newMeta,
                        ]
                    )
                );
            }
        }
    }
public function generateAlteredMeta ( ) { //get unmanaged converted to managed $ managed = array_intersect ( $ this -> oldUnmanagedKeys , $ this -> newModelKeys ) ; //get managed converted to unmanaged $ unmanaged = array_intersect ( $ this -> oldModelKeys , $ this -> newUnmanagedKeys ) ; $ modelsToCheck = array_merge ( $ this -> keptProxyKeys , $ this -> keptUnmanagedKeys , $ managed , $ unmanaged ) ; $ modelsToCheck = array_unique ( $ modelsToCheck ) ; /* @var $oldState ModelState */ /* @var $newState ModelState */ foreach ( $ modelsToCheck as $ modelName ) { $ oldModelName = $ this -> getOldModelName ( $ modelName ) ; $ oldState = $ this -> fromState -> getModelState ( $ oldModelName ) ; $ newState = $ this -> toState -> getModelState ( $ modelName ) ; $ oldMeta = [ ] ; if ( $ oldState -> getMeta ( ) ) { foreach ( $ oldState -> getMeta ( ) as $ name => $ opt ) { if ( AlterModelMeta :: isAlterableOption ( $ name ) ) { $ oldMeta [ $ name ] = $ opt ; } } } $ newMeta = [ ] ; if ( $ newState -> getMeta ( ) ) { foreach ( $ newState -> getMeta ( ) as $ name => $ opt ) { if ( AlterModelMeta :: isAlterableOption ( $ name ) ) { $ newMeta [ $ name ] = $ opt ; } } } if ( $ oldMeta !== $ newMeta ) { $ this -> addOperation ( $ newMeta -> getAppName ( ) , AlterModelMeta :: createObject ( [ 'name' => $ modelName , 'meta' => $ newMeta , ] ) ) ; } } }
Works out if any non-schema-affecting options have changed and makes
an operation to represent them in state
changes.

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
Works out if any non - schema - affecting options have changed and makes an operation to represent them in state changes .