[TASK] Re-work/simplify copyright header in PHP files - Part 8
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / Qom / Ordering.php
1 <?php
2 namespace 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 * Determines the relative order of two rows in the result set by evaluating operand for
18 * each.
19 */
20 class Ordering implements OrderingInterface {
21
22 /**
23 * @var DynamicOperandInterface
24 */
25 protected $operand;
26
27 /**
28 * @var string One of \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_*
29 */
30 protected $order;
31
32 /**
33 * Constructs the Ordering instance
34 *
35 * @param DynamicOperandInterface $operand The operand; non-null
36 * @param string $order One of \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_*
37 */
38 public function __construct(DynamicOperandInterface $operand, $order = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING) {
39 $this->operand = $operand;
40 $this->order = $order;
41 }
42
43 /**
44 * The operand by which to order.
45 *
46 * @return DynamicOperandInterface the operand; non-null
47 */
48 public function getOperand() {
49 return $this->operand;
50 }
51
52 /**
53 * Gets the order.
54 *
55 * @return string One of \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_*
56 */
57 public function getOrder() {
58 return $this->order;
59 }
60 }