Storm\Core\Relational\RelationshipChange::GetPersistedRelationship PHP Method

GetPersistedRelationship() public method

public GetPersistedRelationship ( ) : PersistedRelationship | null
return PersistedRelationship | null
    public function GetPersistedRelationship()
    {
        return $this->PersistedRelationship;
    }

Usage Example

Example #1
0
 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);
             }
         }
     }
 }