本文整理汇总了PHP中Propel\Generator\Model\Column::isLobType方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::isLobType方法的具体用法?PHP Column::isLobType怎么用?PHP Column::isLobType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Column
的用法示例。
在下文中一共展示了Column::isLobType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getColumnBindingPHP
/**
* Get the PHP snippet for binding a value to a column.
* Warning: duplicates logic from AdapterInterface::bindValue().
* Any code modification here must be ported there.
*/
public function getColumnBindingPHP(Column $column, $identifier, $columnValueAccessor, $tab = " ")
{
$script = '';
if ($column->isTemporalType()) {
$columnValueAccessor = $columnValueAccessor . " ? " . $columnValueAccessor . "->format(\"" . $this->getTimeStampFormatter() . "\") : null";
} elseif ($column->isLobType()) {
// we always need to make sure that the stream is rewound, otherwise nothing will
// get written to database.
$script .= "\nif (is_resource({$columnValueAccessor})) {\n rewind({$columnValueAccessor});\n}";
}
$script .= sprintf("\n\$stmt->bindValue(%s, %s, %s);", $identifier, $columnValueAccessor, PropelTypes::getPdoTypeString($column->getType()));
return preg_replace('/^(.+)/m', $tab . '$1', $script);
}
示例2: testLobType
/**
* @dataProvider provideMappingLobTypes
*/
public function testLobType($mappingType, $phpType, $isPhpPrimitiveType)
{
$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($phpType, $column->getPhpType());
$this->assertSame($isPhpPrimitiveType, $column->isPhpPrimitiveType());
$this->assertTrue($column->isLobType());
}