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