Storm\Drivers\Base\Relational\Traits\ForeignKey::GetReferencedTable PHP Method

GetReferencedTable() final public method

final public GetReferencedTable ( ) : Table
return Storm\Core\Relational\Table
    public final function GetReferencedTable()
    {
        return $this->ReferencedTable;
    }

Usage Example

Ejemplo n.º 1
0
 public function Persist(Relational\Transaction $Transaction, Relational\ResultRow $ParentData, array $RelationshipChanges)
 {
     /* @var $RelationshipChanges Relational\RelationshipChange[] */
     $JoinRowsWithoutPrimaryKeys = [];
     foreach ($RelationshipChanges as $RelationshipChange) {
         if ($RelationshipChange->HasPersistedRelationship()) {
             $JoinRow = $this->MapPersistedRelationshipToJoinRow($RelationshipChange->GetPersistedRelationship());
             $Transaction->Persist($JoinRow);
             if (!$JoinRow->HasPrimaryKey()) {
                 $JoinRowsWithoutPrimaryKeys[] = $JoinRow;
             }
         }
         if ($RelationshipChange->HasDiscardedRelationship()) {
             $JoinRow = $this->MapDiscardedRelationshipToJoinRow($RelationshipChange->GetDiscardedRelationship());
             $Transaction->Discard($JoinRow->GetPrimaryKey());
         }
     }
     if (count($JoinRowsWithoutPrimaryKeys) > 0) {
         $ParentRow = $ParentData->GetRow($this->ParentForeignKey->GetReferencedTable());
         $Transaction->SubscribeToPrePersistEvent($this->JoinTable, function () use(&$ParentRow, &$JoinRowsWithoutPrimaryKeys) {
             foreach ($JoinRowsWithoutPrimaryKeys as $JoinRowWithoutPrimaryKey) {
                 $this->ParentForeignKey->MapReferencedToParentKey($ParentRow, $JoinRowWithoutPrimaryKey);
             }
         });
     }
 }
All Usage Examples Of Storm\Drivers\Base\Relational\Traits\ForeignKey::GetReferencedTable