source/Spiral/ORM/RecordEntity.php
private function handleInsert(InsertCommand $command)
    {
        //Mounting PK
        $this->setField($this->primaryColumn(), $command->getInsertID(), true, false);

        //Once command executed we will know some information about it's context
        //(for exampled added FKs), this information must already be in database (added to command),
        //so no need to track changes
        foreach ($command->getContext() as $name => $value) {
            $this->setField($name, $value, true, false);
        }

        $this->state = ORMInterface::STATE_LOADED;
        $this->dispatch('created', new RecordEvent($this, $command));
    }
private function handleInsert(InsertCommand $command)
    {
        //Mounting PK
        $this->setField($this->primaryColumn(), $command->getInsertID(), true, false);

        //Once command executed we will know some information about it's context
        //(for exampled added FKs), this information must already be in database (added to command),
        //so no need to track changes
        foreach ($command->getContext() as $name => $value) {
            $this->setField($name, $value, true, false);
        }

        $this->state = ORMInterface::STATE_LOADED;
        $this->dispatch('created', new RecordEvent($this, $command));
    }
private function handleInsert ( InsertCommand $ command ) { //Mounting PK $ this -> setField ( $ this -> primaryColumn ( ) , $ command -> getInsertID ( ) , true , false ) ; //Once command executed we will know some information about it's context //(for exampled added FKs), this information must already be in database (added to command), //so no need to track changes foreach ( $ command -> getContext ( ) as $ name => $ value ) { $ this -> setField ( $ name , $ value , true , false ) ; } $ this -> state = ORMInterface :: STATE_LOADED ; $ this -> dispatch ( 'created' , new RecordEvent ( $ this , $ command ) ) ; }
Handle result of insert command.

@param InsertCommand $command
Handle result of insert command .