FOF30\Model\DataModel\RelationManager::getForeignKeyMap PHP Метод

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

Gets the foreign key map of a many-to-many relation
public getForeignKeyMap ( string $name ) : array
$name string The name of the relation to return data for
Результат array
    public function &getForeignKeyMap($name)
    {
        if (!isset($this->relations[$name])) {
            throw new DataModel\Relation\Exception\RelationNotFound("Relation '{$name}' not found");
        }
        return $this->relations[$name]->getForeignKeyMap();
    }

Usage Example

Пример #1
0
 /**
  * @group       RelationManager
  * @group       RelationManagerGetForeignKeyMap
  * @covers      FOF30\Model\DataModel\RelationManager::getForeignKeyMap
  */
 public function testGetForeignKeyMapException()
 {
     $this->setExpectedException('\\FOF30\\Model\\DataModel\\Relation\\Exception\\RelationNotFound');
     $model = $this->buildModel();
     $relation = new RelationManager($model);
     $relation->getForeignKeyMap('test');
 }