本文整理汇总了PHP中Propel\Generator\Model\Column::isNumericType方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::isNumericType方法的具体用法?PHP Column::isNumericType怎么用?PHP Column::isNumericType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Column
的用法示例。
在下文中一共展示了Column::isNumericType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addFilterByColBetween
protected function addFilterByColBetween(Column $col)
{
$script = '';
if ($col->isNumericType() || $col->isTemporalType()) {
$colPhpName = $col->getPhpName();
$variableName = $col->getCamelCaseName();
$queryClassName = $this->getQueryClassName();
$script .= <<<SCRIPT
/**
* Applies SprykerCriteria::BETWEEN filtering criteria for the column.
*
* @param array \${$variableName} Filter value.
* [
* 'min' => 3, 'max' => 5
* ]
*
* 'min' and 'max' are optional, when neither is specified, throws \\Spryker\\Zed\\Propel\\Business\\Exception\\AmbiguousComparisonException.
*
* @return \$this|{$queryClassName} The current query, for fluid interface
*/
public function filterBy{$colPhpName}_Between(array \${$variableName})
{
return \$this->filterBy{$colPhpName}(\${$variableName}, SprykerCriteria::BETWEEN);
}
SCRIPT;
}
return $script;
}
示例2: testNumericType
/**
* @dataProvider provideMappingNumericTypes
*/
public function testNumericType($mappingType, $phpType, $isPrimitiveNumericType)
{
$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->assertTrue($column->isPhpPrimitiveType());
$this->assertSame($isPrimitiveNumericType, $column->isPhpPrimitiveNumericType());
$this->assertTrue($column->isNumericType());
}