本文整理匯總了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());
}