本文整理汇总了PHP中Propel\Generator\Model\Column::getPhpType方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::getPhpType方法的具体用法?PHP Column::getPhpType怎么用?PHP Column::getPhpType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Column
的用法示例。
在下文中一共展示了Column::getPhpType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDateTimeClass
protected function getDateTimeClass(Column $column)
{
if (PropelTypes::isPhpObjectType($column->getPhpType())) {
return $column->getPhpType();
}
$dateTimeClass = $this->getBuildProperty('generator.dateTime.dateTimeClass');
if (!$dateTimeClass) {
$dateTimeClass = '\\DateTime';
}
return $dateTimeClass;
}
示例2: addMutatorComment
/**
* Adds the comment for a mutator
* @param string &$script The script will be modified in this method.
* @param Column $col The current column.
* @see addMutatorOpen()
**/
public function addMutatorComment(&$script, Column $col)
{
$clo = strtolower($col->getName());
$script .= "\n /**\n * Set the value of [{$clo}] column.\n * " . $col->getDescription() . "\n * @param " . $col->getPhpType() . " \$v new value\n * @return " . $this->getObjectClassname() . " The current object (for fluent API support)\n */";
}
示例3: addMutatorComment
/**
* Adds the comment for a mutator.
*
* @param string &$script
* @param Column $column
*/
public function addMutatorComment(&$script, Column $column)
{
$clo = $column->getLowercasedName();
$script .= "\n /**\n * Set the value of [{$clo}] column.\n * " . $column->getDescription() . "\n * @param " . $column->getPhpType() . " \$v new value\n * @return \$this|" . $this->getObjectClassName(true) . " The current object (for fluent API support)\n */";
}
示例4: testTextType
/**
* @dataProvider provideMappingTextTypes
*/
public function testTextType($mappingType)
{
$domain = $this->getDomainMock();
$domain->expects($this->once())->method('setType')->with($this->equalTo($mappingType));
$domain->expects($this->any())->method('getType')->will($this->returnValue($mappingType));
$column = new Column();
$column->setDomain($domain);
$column->setType($mappingType);
$this->assertSame('string', $column->getPhpType());
$this->assertTrue($column->isPhpPrimitiveType());
$this->assertTrue($column->isTextType());
}