protected function postStoreProcess()
    {
        $aggregate = $this->aggregate;

        // Create any related object that doesn't exist in the database.
        $foreignRelationships = $aggregate->getEntityMap()->getForeignRelationships();

        $this->createRelatedEntities($foreignRelationships);

        // Update any pivot tables that has been modified.
        $aggregate->updatePivotRecords();

        // Update any dirty relationship. This include relationships that already exists, have
        // dirty attributes / newly created related entities / dirty related entities.
        $dirtyRelatedAggregates = $aggregate->getDirtyRelationships();

        foreach ($dirtyRelatedAggregates as $related) {
            $this->createStoreCommand($related)->execute();
        }

        // Now we can sync the related collections
        //
        // TODO (note) : not sure this check is needed, as we can assume
        // the aggregate exists in the Post Store Process
        if ($this->aggregate->exists()) {
            $this->aggregate->syncRelationships($foreignRelationships);
        }

        // TODO be move it to the wrapper class
        // so it's the same code for the entity builder
        $aggregate->setProxies();

        // Update Entity Cache
        $aggregate->getMapper()->getEntityCache()->refresh($aggregate);
    }
protected function postStoreProcess()
    {
        $aggregate = $this->aggregate;

        // Create any related object that doesn't exist in the database.
        $foreignRelationships = $aggregate->getEntityMap()->getForeignRelationships();

        $this->createRelatedEntities($foreignRelationships);

        // Update any pivot tables that has been modified.
        $aggregate->updatePivotRecords();

        // Update any dirty relationship. This include relationships that already exists, have
        // dirty attributes / newly created related entities / dirty related entities.
        $dirtyRelatedAggregates = $aggregate->getDirtyRelationships();

        foreach ($dirtyRelatedAggregates as $related) {
            $this->createStoreCommand($related)->execute();
        }

        // Now we can sync the related collections
        //
        // TODO (note) : not sure this check is needed, as we can assume
        // the aggregate exists in the Post Store Process
        if ($this->aggregate->exists()) {
            $this->aggregate->syncRelationships($foreignRelationships);
        }

        // TODO be move it to the wrapper class
        // so it's the same code for the entity builder
        $aggregate->setProxies();

        // Update Entity Cache
        $aggregate->getMapper()->getEntityCache()->refresh($aggregate);
    }
protected function postStoreProcess ( ) { $ aggregate = $ this -> aggregate ; // Create any related object that doesn't exist in the database. $ foreignRelationships = $ aggregate -> getEntityMap ( ) -> getForeignRelationships ( ) ; $ this -> createRelatedEntities ( $ foreignRelationships ) ; // Update any pivot tables that has been modified. $ aggregate -> updatePivotRecords ( ) ; // Update any dirty relationship. This include relationships that already exists, have // dirty attributes / newly created related entities / dirty related entities. $ dirtyRelatedAggregates = $ aggregate -> getDirtyRelationships ( ) ; foreach ( $ dirtyRelatedAggregates as $ related ) { $ this -> createStoreCommand ( $ related ) -> execute ( ) ; } // Now we can sync the related collections // // TODO (note) : not sure this check is needed, as we can assume // the aggregate exists in the Post Store Process if ( $ this -> aggregate -> exists ( ) ) { $ this -> aggregate -> syncRelationships ( $ foreignRelationships ) ; } // TODO be move it to the wrapper class // so it's the same code for the entity builder $ aggregate -> setProxies ( ) ; // Update Entity Cache $ aggregate -> getMapper ( ) -> getEntityCache ( ) -> refresh ( $ aggregate ) ; }
Run all operations that have to occur after the entity
is stored.

@throws \InvalidArgumentException

@return void
Run all operations that have to occur after the entity is stored .