本文整理汇总了PHP中Propel\Generator\Model\Table::hasDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::hasDescription方法的具体用法?PHP Table::hasDescription怎么用?PHP Table::hasDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Table
的用法示例。
在下文中一共展示了Table::hasDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAddTableDDL
public function getAddTableDDL(Table $table)
{
$tableDescription = $table->hasDescription() ? $this->getCommentLineDDL($table->getDescription()) : '';
$lines = array();
foreach ($table->getColumns() as $column) {
$lines[] = $this->getColumnDDL($column);
}
if ($table->hasPrimaryKey() && count($table->getPrimaryKey()) > 1) {
$lines[] = $this->getPrimaryKeyDDL($table);
}
foreach ($table->getUnices() as $unique) {
$lines[] = $this->getUniqueDDL($unique);
}
$sep = ",\n ";
$pattern = "\n%sCREATE TABLE %s\n(\n %s\n);\n";
return sprintf($pattern, $tableDescription, $this->quoteIdentifier($table->getName()), implode($sep, $lines));
}
示例2: getAddTableDDL
public function getAddTableDDL(Table $table)
{
$tableDescription = $table->hasDescription() ? $this->getCommentLineDDL($table->getDescription()) : '';
$lines = [];
foreach ($table->getColumns() as $column) {
$lines[] = $this->getColumnDDL($column);
}
foreach ($table->getUnices() as $unique) {
$lines[] = $this->getUniqueDDL($unique);
}
$sep = ",\n ";
$pattern = "\n%sCREATE TABLE %s\n(\n %s\n)%s;\n";
$ret = sprintf($pattern, $tableDescription, $this->quoteIdentifier($table->getName()), implode($sep, $lines), $this->generateBlockStorage($table));
$ret .= $this->getAddPrimaryKeyDDL($table);
$ret .= $this->getAddSequencesDDL($table);
return $ret;
}
示例3: testSetDescription
public function testSetDescription()
{
$table = new Table();
$this->assertFalse($table->hasDescription());
$table->setDescription('Some description');
$this->assertTrue($table->hasDescription());
$this->assertSame('Some description', $table->getDescription());
}