Neos\Flow\Persistence\Generic\Qom\QueryObjectModelFactory::lowerCase PHP Метод

lowerCase() публичный Метод

Evaluates to the lower-case string value (or values, if multi-valued) of an operand.
public lowerCase ( DynamicOperand $operand ) : LowerCase
$operand DynamicOperand the operand whose value is converted to a lower-case string; non-null
Результат LowerCase the operand; non-null
    public function lowerCase(DynamicOperand $operand)
    {
        return new LowerCase($operand);
    }

Usage Example

Пример #1
0
 /**
  * Returns a like criterion used for matching objects against a query.
  * Matches if the property named $propertyName is like the $operand, using
  * standard SQL wildcards.
  *
  * @param string $propertyName The name of the property to compare against
  * @param string $operand The value to compare with
  * @param boolean $caseSensitive Whether the matching should be done case-sensitive
  * @return object
  * @throws InvalidQueryException if used on a non-string property
  * @api
  */
 public function like($propertyName, $operand, $caseSensitive = true)
 {
     if (!is_string($operand)) {
         throw new InvalidQueryException('Operand must be a string, was ' . gettype($operand), 1276781107);
     }
     if ($caseSensitive) {
         $comparison = $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, '_entity'), QueryInterface::OPERATOR_LIKE, $operand);
     } else {
         $comparison = $this->qomFactory->comparison($this->qomFactory->lowerCase($this->qomFactory->propertyValue($propertyName, '_entity')), QueryInterface::OPERATOR_LIKE, strtolower($operand));
     }
     return $comparison;
 }