本文整理匯總了PHP中Propel\Generator\Model\Index::getTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Index::getTable方法的具體用法?PHP Index::getTable怎麽用?PHP Index::getTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Propel\Generator\Model\Index
的用法示例。
在下文中一共展示了Index::getTable方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCreateNamedIndex
public function testCreateNamedIndex()
{
$index = new Index('foo_idx');
$index->setTable($this->getTableMock('db_books'));
$this->assertEquals('foo_idx', $index->getName());
$this->assertFalse($index->isUnique());
$this->assertInstanceOf('Propel\\Generator\\Model\\Table', $index->getTable());
$this->assertSame('db_books', $index->getTableName());
$this->assertCount(0, $index->getColumns());
$this->assertFalse($index->hasColumns());
}
示例2: getDropIndexDDL
/**
* Builds the DDL SQL to drop an Index.
*
* @param Index $index
* @return string
*/
public function getDropIndexDDL(Index $index)
{
$pattern = "\nDROP INDEX %s ON %s;\n";
return sprintf($pattern, $this->quoteIdentifier($index->getName()), $this->quoteIdentifier($index->getTable()->getName()));
}
示例3: getAddIndexDDL
/**
* Builds the DDL SQL to add an Index.
*
* @param Index $index
* @return string
*/
public function getAddIndexDDL(Index $index)
{
// don't create index form primary key
if ($this->getPrimaryKeyName($index->getTable()) == $this->quoteIdentifier($index->getName())) {
return '';
}
$pattern = "\nCREATE %sINDEX %s ON %s (%s)%s;\n";
return sprintf($pattern, $index->isUnique() ? 'UNIQUE ' : '', $this->quoteIdentifier($index->getName()), $this->quoteIdentifier($index->getTable()->getName()), $this->getColumnListDDL($index->getColumnObjects()), $this->generateBlockStorage($index));
}
示例4: getDropIndexDDL
/**
* Overrides the implementation from DefaultPlatform
*
* @author Niklas Närhinen <niklas@narhinen.net>
* @return string
* @see DefaultPlatform::getDropIndexDDL
*/
public function getDropIndexDDL(Index $index)
{
if ($index instanceof Unique) {
$pattern = "\n ALTER TABLE %s DROP CONSTRAINT %s;\n ";
return sprintf($pattern, $this->quoteIdentifier($index->getTable()->getName()), $this->quoteIdentifier($index->getName()));
} else {
return parent::getDropIndexDDL($index);
}
}
示例5: getAddIndexDDL
/**
* Returns the DDL SQL to add an Index.
*
* @param Index $index
* @return string
*/
public function getAddIndexDDL(Index $index)
{
$pattern = "\nCREATE %sINDEX %s ON %s (%s);\n";
return sprintf($pattern, $index->isUnique() ? 'UNIQUE ' : '', $this->quoteIdentifier($index->getName()), $this->quoteIdentifier($index->getTable()->getName()), $this->getColumnListDDL($index->getColumnObjects()));
}