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

Persist() публичный Метод

public Persist ( Transaction $Transaction, ResultRow $ParentData, RelationshipChange $RelationshipChange )
$Transaction Storm\Core\Relational\Transaction
$ParentData Storm\Core\Relational\ResultRow
$RelationshipChange Storm\Core\Relational\RelationshipChange
    public function Persist(Relational\Transaction $Transaction, Relational\ResultRow $ParentData, Relational\RelationshipChange $RelationshipChange)
    {
        if ($RelationshipChange->HasPersistedRelationship()) {
            $PersistedRelationship = $RelationshipChange->GetPersistedRelationship();
            if ($PersistedRelationship->IsIdentifying()) {
                $ParentRow = $ParentData->GetRow($this->GetParentTable());
                $ChildRow = $PersistedRelationship->GetChildResultRow()->GetRow($this->GetTable());
                $this->PersistIdentifyingRelationship($Transaction, $ParentRow, $ChildRow);
            } else {
                $RelatedPrimaryKey = $PersistedRelationship->GetRelatedPrimaryKey();
                if ($this->IsInversed()) {
                    $this->GetForeignKey()->MapParentToReferencedKey($RelatedPrimaryKey, $ParentData);
                } else {
                    $this->GetForeignKey()->MapReferencedToParentKey($RelatedPrimaryKey, $ParentData);
                }
            }
        }
    }