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 lower-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 LowerCase operand also evaluates to null.
26 * @internal only to be used within Extbase, not part of TYPO3 Core API.
27 */
28class LowerCase implements LowerCaseInterface
29{
30    /**
31     * @var PropertyValueInterface
32     */
33    protected $operand;
34
35    /**
36     * Constructs this LowerCase 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 a lower-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 'LOWER' . $this->operand->getPropertyName();
73    }
74}
75