Storm\Drivers\Base\Relational\Relations\ToOneRelationBase::PersistIdentifyingRelationship PHP Метод

PersistIdentifyingRelationship() закрытый защищенный Метод

final protected PersistIdentifyingRelationship ( Transaction $Transaction, ResultRow $ParentData, ResultRow $ChildData )
$Transaction Storm\Core\Relational\Transaction
$ParentData Storm\Core\Relational\ResultRow
$ChildData Storm\Core\Relational\ResultRow
    protected final function PersistIdentifyingRelationship(Relational\Transaction $Transaction, Relational\ResultRow $ParentData, Relational\ResultRow $ChildData)
    {
        $ForeignKey = $this->GetForeignKey();
        /**
         * In case the foreign key is part of the primary key and the row has
         * not been persisted yet.
         */
        $HasForeignKey = $this->IsInversed() ? $ForeignKey->HasReferencedKey($ParentData) : $ForeignKey->HasParentKey($ParentData);
        if ($HasForeignKey) {
            $this->MapRelationalParentDataToRelatedData($ParentData, $ChildData);
        } else {
            $Transaction->SubscribeToPrePersistEvent($ChildData, function () use(&$ParentData, &$ChildData) {
                $this->MapRelationalParentDataToRelatedData($ParentRow, $ChildRow);
            });
        }
    }