protected function updateParentKey(Model $currentParent)
    {
        $parentModel = $this->relation->getParent();

        $keyName = $parentModel->getKeyName();

        $parentModel->$keyName = $currentParent->$keyName;
    }
protected function updateParentKey(Model $currentParent)
    {
        $parentModel = $this->relation->getParent();

        $keyName = $parentModel->getKeyName();

        $parentModel->$keyName = $currentParent->$keyName;
    }
protected function updateParentKey ( Model $ currentParent ) { $ parentModel = $ this -> relation -> getParent ( ) ; $ keyName = $ parentModel -> getKeyName ( ) ; $ parentModel -> $ keyName = $ currentParent -> $ keyName ; }
Set the primary key of the parent model to the one of the model being built.
This is necessary because the relation was instantiated on ModelPopulator's construction.

@param  Model $currentParent
@return void
Set the primary key of the parent model to the one of the model being built . This is necessary because the relation was instantiated on ModelPopulator s construction .