本文整理汇总了PHP中Propel\Generator\Model\Column::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::setName方法的具体用法?PHP Column::setName怎么用?PHP Column::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Column
的用法示例。
在下文中一共展示了Column::setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMakeList
/**
* Tests static Column::makeList() method.
* @deprecated - Column::makeList() is deprecated and set to be removed in 1.3
*/
public function testMakeList()
{
$expected = 'Column0, Column1, Column2, Column3, Column4';
$objArray = array();
for ($i = 0; $i < 5; $i++) {
$c = new Column();
$c->setName("Column" . $i);
$objArray[] = $c;
}
$list = Column::makeList($objArray, new DefaultPlatform());
$this->assertEquals($expected, $list, sprintf("Expected '%s' match, got '%s' ", var_export($expected, true), var_export($list, true)));
$strArray = array();
for ($i = 0; $i < 5; $i++) {
$strArray[] = "Column" . $i;
}
$list = Column::makeList($strArray, new DefaultPlatform());
$this->assertEquals($expected, $list, sprintf("Expected '%s' match, got '%s' ", var_export($expected, true), var_export($list, true)));
}
示例2: providerForTestGetModifyColumnRemoveDefaultValueDDL
public function providerForTestGetModifyColumnRemoveDefaultValueDDL()
{
$t1 = new Table('test');
$t1->setIdentifierQuoting(true);
$c1 = new Column();
$c1->setName('test');
$c1->getDomain()->setType('INTEGER');
$c1->setDefaultValue(0);
$t1->addColumn($c1);
$t2 = new Table('test');
$t2->setIdentifierQuoting(true);
$c2 = new Column();
$c2->setName('test');
$c2->getDomain()->setType('INTEGER');
$t2->addColumn($c2);
return [[ColumnComparator::computeDiff($c1, $c2)]];
}
示例3: providerForTestGetModifyColumnRemoveDefaultValueDDL
public function providerForTestGetModifyColumnRemoveDefaultValueDDL()
{
$t1 = new Table('test');
$c1 = new Column();
$c1->setName('test');
$c1->getDomain()->setType('INTEGER');
$c1->setDefaultValue(0);
$t1->addColumn($c1);
$t2 = new Table('test');
$c2 = new Column();
$c2->setName('test');
$c2->getDomain()->setType('INTEGER');
$t2->addColumn($c2);
return array(array(PropelColumnComparator::computeDiff($c1, $c2)));
}