当前位置: 首页>>代码示例>>PHP>>正文


PHP Column::setScale方法代码示例

本文整理汇总了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();
开发者ID:disider,项目名称:Propel2,代码行数:31,代码来源:blog-database.php

示例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());
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:10,代码来源:ColumnTest.php

示例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));
 }
开发者ID:SwissalpS,项目名称:Propel2,代码行数:11,代码来源:MysqlPlatformTest.php

示例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();
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:31,代码来源:blog-database.php


注:本文中的Propel\Generator\Model\Column::setScale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。