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


PHP TypeHandling::isLiteral方法代码示例

本文整理汇总了PHP中TYPO3\Flow\Utility\TypeHandling::isLiteral方法的典型用法代码示例。如果您正苦于以下问题:PHP TypeHandling::isLiteral方法的具体用法?PHP TypeHandling::isLiteral怎么用?PHP TypeHandling::isLiteral使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\Flow\Utility\TypeHandling的用法示例。


在下文中一共展示了TypeHandling::isLiteral方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: greaterThanOrEqual

 /**
  * Returns a greater than or equal criterion used for matching objects against a query
  *
  * @param string $propertyName The name of the property to compare against
  * @param mixed $operand The value to compare with
  * @return \TYPO3\Flow\Persistence\Generic\Qom\Comparison
  * @throws \TYPO3\Flow\Persistence\Exception\InvalidQueryException if used on a multi-valued property or with a non-literal/non-DateTime operand
  * @api
  */
 public function greaterThanOrEqual($propertyName, $operand)
 {
     if ($this->classSchema->isMultiValuedProperty($propertyName)) {
         throw new \TYPO3\Flow\Persistence\Exception\InvalidQueryException('Property "' . $propertyName . '" must not be multi-valued', 1276774883);
     }
     if (!$operand instanceof \DateTime && !\TYPO3\Flow\Utility\TypeHandling::isLiteral(gettype($operand))) {
         throw new \TYPO3\Flow\Persistence\Exception\InvalidQueryException('Operand must be a literal or DateTime, was ' . gettype($operand), 1276774884);
     }
     return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, '_entity'), \TYPO3\Flow\Persistence\QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO, $operand);
 }
开发者ID:sokunthearith,项目名称:Intern-Project-Week-2,代码行数:19,代码来源:Query.php

示例2: isLiteralReturnsTrueForLiteralType

 /**
  * @test
  * @dataProvider literalTypes
  */
 public function isLiteralReturnsTrueForLiteralType($type)
 {
     $this->assertTrue(TypeHandling::isLiteral($type), 'Failed for ' . $type);
 }
开发者ID:mkeitsch,项目名称:flow-development-collection,代码行数:8,代码来源:TypeHandlingTest.php

示例3: operandIsSimpleType

 /**
  * @param string $type
  * @return boolean TRUE if operand is a simple type (object, array, string, ...); i.e. everything which is NOT a class name
  */
 protected function operandIsSimpleType($type)
 {
     return $type === 'object' || $type === 'array' || \TYPO3\Flow\Utility\TypeHandling::isLiteral($type);
 }
开发者ID:Weissheiten,项目名称:flow-development-collection,代码行数:8,代码来源:FilterOperation.php


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