本文整理汇总了PHP中Propel\Generator\Model\Table::addReferrer方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::addReferrer方法的具体用法?PHP Table::addReferrer怎么用?PHP Table::addReferrer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Table
的用法示例。
在下文中一共展示了Table::addReferrer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddReferrerForeignKey
public function testAddReferrerForeignKey()
{
$table = new Table('books');
$table->addReferrer($this->getForeignKeyMock());
$this->assertCount(1, $table->getReferrers());
}
示例2: testGetCrossForeignKeys
public function testGetCrossForeignKeys()
{
$crossTable1 = new Table();
$crossTable1->setIsCrossRef(true);
$crossTable2 = new Table();
$crossTable2->setIsCrossRef(true);
$referrerFK1 = $this->getForeignKeyMock('cross_fk1', array('table' => $crossTable1, 'other_fks' => array($this->getForeignKeyMock('cross_fk1_1'), $this->getForeignKeyMock('cross_fk1_2'))));
$referrerFK2 = $this->getForeignKeyMock('cross_fk2', array('table' => $crossTable2, 'other_fks' => array($this->getForeignKeyMock('cross_fk2_1'))));
$table = new Table();
$table->addReferrer($referrerFK1);
$table->addReferrer($referrerFK2);
$this->assertTrue($table->hasCrossForeignKeys());
$this->assertCount(3, $table->getCrossFks());
}