本文整理汇总了PHP中Propel\Generator\Model\Column::setScale方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::setScale方法的具体用法?PHP Column::setScale怎么用?PHP Column::setScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Column
的用法示例。
在下文中一共展示了Column::setScale方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Column
$column11 = new Column('id', 'integer', 7);
$column11->setAutoIncrement();
$column11->setNotNull();
$column11->setPrimaryKey();
$column12 = new Column('author_id', 'smallint', 3);
$column12->setNotNull();
$column13 = new Column('category_id', 'tinyint', 2);
$column13->setNotNull();
$column14 = new Column('title', 'varchar', 100);
$column14->setNotNull();
$column15 = new Column('body', 'clob');
$column16 = new Column('average_rating', 'float', 2);
$column16->setScale(2);
$column16->setDescription('The post rating in percentage');
$column17 = new Column('price_without_decimal_places', 'DECIMAL', 10);
$column17->setScale(0);
$column17->setDescription('The Price without decimal places');
$column21 = new Column('id', 'smallint', 3);
$column21->setAutoIncrement();
$column21->setNotNull();
$column21->setPrimaryKey();
$column22 = new Column('username', 'varchar', 15);
$column22->setNotNull();
$column23 = new Column('password', 'varchar', 40);
$column23->setNotNull();
$column31 = new Column('id', 'tinyint', 2);
$column31->setAutoIncrement();
$column31->setNotNull();
$column31->setPrimaryKey();
$column32 = new Column('name', 'varchar', 40);
$column32->setNotNull();
示例2: testSetScale
public function testSetScale()
{
$domain = $this->getDomainMock();
$domain->expects($this->once())->method('setScale')->with($this->equalTo(2));
$domain->expects($this->once())->method('getScale')->will($this->returnValue(2));
$column = new Column();
$column->setDomain($domain);
$column->setScale(2);
$this->assertSame(2, $column->getScale());
}
示例3: 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));
}
示例4: Column
use Propel\Generator\Model\VendorInfo;
use Propel\Generator\Platform\MysqlPlatform;
/* Columns */
$column11 = new Column('id', 'integer', 7);
$column11->setAutoIncrement();
$column11->setNotNull();
$column11->setPrimaryKey();
$column12 = new Column('author_id', 'smallint', 3);
$column12->setNotNull();
$column13 = new Column('category_id', 'tinyint', 2);
$column13->setNotNull();
$column14 = new Column('title', 'varchar', 100);
$column14->setNotNull();
$column15 = new Column('body', 'clob');
$column16 = new Column('average_rating', 'float', 2);
$column16->setScale(2);
$column16->setDescription('The post rating in percentage');
$column21 = new Column('id', 'smallint', 3);
$column21->setAutoIncrement();
$column21->setNotNull();
$column21->setPrimaryKey();
$column22 = new Column('username', 'varchar', 15);
$column22->setNotNull();
$column23 = new Column('password', 'varchar', 40);
$column23->setNotNull();
$column31 = new Column('id', 'tinyint', 2);
$column31->setAutoIncrement();
$column31->setNotNull();
$column31->setPrimaryKey();
$column32 = new Column('name', 'varchar', 40);
$column32->setNotNull();