本文整理汇总了PHP中Propel\Generator\Model\Table::getColumnForeignKeys方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::getColumnForeignKeys方法的具体用法?PHP Table::getColumnForeignKeys怎么用?PHP Table::getColumnForeignKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Table
的用法示例。
在下文中一共展示了Table::getColumnForeignKeys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getForeignKeys
/**
* Returns the foreign key objects for this column.
*
* Only if it is a foreign key or part of a foreign key.
*
* @return ForeignKey[]
*/
public function getForeignKeys()
{
return $this->parentTable->getColumnForeignKeys($this->name);
}
示例2: testGetColumnForeignKeys
public function testGetColumnForeignKeys()
{
$fk1 = $this->getForeignKeyMock('fk1', array('local_columns' => array('foo', 'author_id', 'bar')));
$fk2 = $this->getForeignKeyMock('fk2', array('local_columns' => array('foo', 'bar')));
$table = new Table();
$table->addForeignKey($fk1);
$table->addForeignKey($fk2);
$this->assertCount(1, $table->getColumnForeignKeys('author_id'));
$this->assertContains($fk1, $table->getColumnForeignKeys('author_id'));
}
示例3: addParentColumn
protected function addParentColumn(Table $table, $id_name)
{
$name = $this->getParameter('parent_name');
//Остановился тут
if (!$table->getColumnForeignKeys($name)) {
//var_dump($table->getColumnForeignKeys('parent_id'));
//foreach($table->getForeignKeys() as $column) {
// var_dump($column->getForeignColumns(), $column->getName());
//}
}
foreach ($table->getDatabase()->getTables() as $table) {
//echo $table->getName()."\n";
}
//exit;
}