public function generateCreatedProxies()
    {
        $addedProxies = array_diff($this->newProxyKeys, $this->oldProxyKeys);

        /* @var $modelState ModelState */
        foreach ($addedProxies as $addedProxy) {
            $meta = $this->newRegistry
                ->getModel($addedProxy)->getMeta();
            $modelState = $this->toState->getModelState($addedProxy);
            assert($modelState->getMeta()['proxy']);

            $opDep = [
                [
                    'app' => $meta->getAppName(),
                    'target' => $addedProxy,
                    'type' => self::TYPE_MODEL,
                    'action' => self::ACTION_DROPPED,
                ],
            ];
            // create operation
            $this->addOperation(
                $meta->getAppName(),
                CreateModel::createObject(
                    [
                        'name' => $modelState->name,
                        'fields' => [],
                        'meta' => $modelState->getMeta(),
                        'extends' => $modelState->extends,
                    ]
                ),
                $opDep
            );
        }
    }
public function generateCreatedProxies()
    {
        $addedProxies = array_diff($this->newProxyKeys, $this->oldProxyKeys);

        /* @var $modelState ModelState */
        foreach ($addedProxies as $addedProxy) {
            $meta = $this->newRegistry
                ->getModel($addedProxy)->getMeta();
            $modelState = $this->toState->getModelState($addedProxy);
            assert($modelState->getMeta()['proxy']);

            $opDep = [
                [
                    'app' => $meta->getAppName(),
                    'target' => $addedProxy,
                    'type' => self::TYPE_MODEL,
                    'action' => self::ACTION_DROPPED,
                ],
            ];
            // create operation
            $this->addOperation(
                $meta->getAppName(),
                CreateModel::createObject(
                    [
                        'name' => $modelState->name,
                        'fields' => [],
                        'meta' => $modelState->getMeta(),
                        'extends' => $modelState->extends,
                    ]
                ),
                $opDep
            );
        }
    }
public function generateCreatedProxies ( ) { $ addedProxies = array_diff ( $ this -> newProxyKeys , $ this -> oldProxyKeys ) ; /* @var $modelState ModelState */ foreach ( $ addedProxies as $ addedProxy ) { $ meta = $ this -> newRegistry -> getModel ( $ addedProxy ) -> getMeta ( ) ; $ modelState = $ this -> toState -> getModelState ( $ addedProxy ) ; assert ( $ modelState -> getMeta ( ) [ 'proxy' ] ) ; $ opDep = [ [ 'app' => $ meta -> getAppName ( ) , 'target' => $ addedProxy , 'type' => self :: TYPE_MODEL , 'action' => self :: ACTION_DROPPED , ] , ] ; // create operation $ this -> addOperation ( $ meta -> getAppName ( ) , CreateModel :: createObject ( [ 'name' => $ modelState -> name , 'fields' => [ ] , 'meta' => $ modelState -> getMeta ( ) , 'extends' => $ modelState -> extends , ] ) , $ opDep ) ; } }
Makes CreateModel statements for proxy models.

We use the same statements as that way there's less code duplication,
but of course for proxy models we can skip
all that pointless field stuff and just chuck out an operation.

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
Makes CreateModel statements for proxy models .