本文整理汇总了PHP中Propel\Generator\Model\Column::setSize方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::setSize方法的具体用法?PHP Column::setSize怎么用?PHP Column::setSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Column
的用法示例。
在下文中一共展示了Column::setSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNormalizeTable
public function testNormalizeTable()
{
$column = new Column('price', 'DECIMAL');
$column->getDomain()->copy($this->getPlatform()->getDomainForType('DECIMAL'));
$column->setSize(10);
$column->setScale(3);
$table = new Table('prices');
$table->addColumns([$column]);
$this->getPlatform()->normalizeTable($table);
$this->assertEquals("`price` DECIMAL(10,3)", $this->getPlatform()->getColumnDDL($column));
}
示例2: testGetIndexDDLKeySize
public function testGetIndexDDLKeySize()
{
$table = new Table('foo');
$table->setIdentifierQuoting(true);
$column1 = new Column('bar1');
$column1->getDomain()->copy($this->getPlatform()->getDomainForType('VARCHAR'));
$column1->setSize(5);
$table->addColumn($column1);
$index = new Index('bar_index');
$index->addColumn($column1);
$table->addIndex($index);
$expected = 'INDEX `bar_index` (`bar1`(5))';
$this->assertEquals($expected, $this->getPlatform()->getIndexDDL($index));
}
示例3: testSetSize
public function testSetSize()
{
$domain = $this->getDomainMock();
$domain->expects($this->once())->method('setSize')->with($this->equalTo(50));
$domain->expects($this->once())->method('getSize')->will($this->returnValue(50));
$column = new Column();
$column->setDomain($domain);
$column->setSize(50);
$this->assertSame(50, $column->getSize());
}