예제 #1
0
 /**
  * Returns an equals 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
  * @param boolean $caseSensitive Whether the equality test should be done case-sensitive
  * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface
  * @api
  */
 public function equals($propertyName, $operand, $caseSensitive = TRUE)
 {
     if (is_object($operand) || $caseSensitive) {
         $comparison = $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_EQUAL_TO, $operand);
     } else {
         $comparison = $this->qomFactory->comparison($this->qomFactory->lowerCase($this->qomFactory->propertyValue($propertyName, $this->getSelectorName())), QueryInterface::OPERATOR_EQUAL_TO, \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Charset\\CharsetConverter')->conv_case(\TYPO3\CMS\Extbase\Persistence\Generic\Query::CHARSET, $operand, 'toLower'));
     }
     return $comparison;
 }
예제 #2
0
 /**
  * Returns an equals 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
  * @param bool $caseSensitive Whether the equality test should be done case-sensitive
  * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface
  * @api
  */
 public function equals($propertyName, $operand, $caseSensitive = true)
 {
     if (is_object($operand) || $caseSensitive) {
         $comparison = $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_EQUAL_TO, $operand);
     } else {
         $comparison = $this->qomFactory->comparison($this->qomFactory->lowerCase($this->qomFactory->propertyValue($propertyName, $this->getSelectorName())), QueryInterface::OPERATOR_EQUAL_TO, mb_strtolower($operand, \TYPO3\CMS\Extbase\Persistence\Generic\Query::CHARSET));
     }
     return $comparison;
 }