1<?php 2namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom; 3 4/* 5 * This file is part of the TYPO3 CMS project. 6 * 7 * It is free software; you can redistribute it and/or modify it under 8 * the terms of the GNU General Public License, either version 2 9 * of the License, or any later version. 10 * 11 * For the full copyright and license information, please read the 12 * LICENSE.txt file that was distributed with this source code. 13 * 14 * The TYPO3 project - inspiring people to share! 15 */ 16 17/** 18 * Evaluates to the upper-case string value (or values, if multi-valued) of 19 * operand. 20 * 21 * If operand does not evaluate to a string value, its value is first converted 22 * to a string. 23 * 24 * If operand evaluates to null, the UpperCase operand also evaluates to null. 25 * 26 * @internal only to be used within Extbase, not part of TYPO3 Core API. 27 */ 28class UpperCase implements UpperCaseInterface 29{ 30 /** 31 * @var PropertyValueInterface 32 */ 33 protected $operand; 34 35 /** 36 * Constructs this UpperCase instance 37 * 38 * @param PropertyValueInterface $operand 39 */ 40 public function __construct(PropertyValueInterface $operand) 41 { 42 $this->operand = $operand; 43 } 44 45 /** 46 * Gets the operand whose value is converted to an upper-case string. 47 * 48 * @return PropertyValueInterface the operand; non-null 49 */ 50 public function getOperand() 51 { 52 return $this->operand; 53 } 54 55 /** 56 * Gets the name of the selector against which to evaluate this operand. 57 * 58 * @return string the selector name; non-null 59 */ 60 public function getSelectorName() 61 { 62 return $this->operand->getSelectorName(); 63 } 64 65 /** 66 * Gets the name of the property. 67 * 68 * @return string the property name; non-null 69 */ 70 public function getPropertyName() 71 { 72 return 'UPPER' . $this->operand->getPropertyName(); 73 } 74} 75