[!!!][~API] Extbase (Persistence): $query->execute() now returns a plain array of...
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Typo3QuerySettings.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
6 * All rights reserved
7 *
8 * This class is a backport of the corresponding class of FLOW3.
9 * All credits go to the v5 team.
10 *
11 * This script is part of the TYPO3 project. The TYPO3 project is
12 * free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27
28 /**
29 * Query settings. This class is NOT part of the FLOW3 API.
30 * It reflects the settings unique to TYPO3 4.x.
31 *
32 * @package Extbase
33 * @subpackage Persistence
34 * @version $Id$
35 * @api
36 */
37 class Tx_Extbase_Persistence_Typo3QuerySettings implements Tx_Extbase_Persistence_Typo3QuerySettingsInterface {
38
39 /**
40 * Flag if the storage page should be respected for the query.
41 * @var boolean
42 */
43 protected $respectStoragePage = TRUE;
44
45 /**
46 * Flag if the visibility settings for the frontend should be respected.
47 * @var boolean
48 */
49 protected $respectEnableFields = TRUE;
50
51 /**
52 * Flag if the sys_language_uid should be respected (default is TRUE).
53 * @var boolean
54 */
55 protected $respectSysLanguage = TRUE;
56
57 /**
58 * Flag if the the query result should be returned as raw QueryResult.
59 * @var boolean
60 */
61 protected $returnRawQueryResult = FALSE;
62
63 /**
64 * Sets the flag if the storage page should be respected for the query.
65 *
66 * @param $respectStoragePage If TRUE the storage page ID will be determined and the statement will be extended accordingly.
67 * @return $this (fluent interface)
68 * @api
69 */
70 public function setRespectStoragePage($respectStoragePage) {
71 $this->respectStoragePage = $respectStoragePage;
72 return $this;
73 }
74
75 /**
76 * Returns the state, if the storage page should be respected for the query.
77 *
78 * @return boolean TRUE, if the storage page should be respected; otherwise FALSE.
79 */
80 public function getRespectStoragePage() {
81 return $this->respectStoragePage;
82 }
83
84 /**
85 * Sets the flag if a and language overlay should be performed.
86 *
87 * @param $respectEnableFields TRUE if a and language overlay should be performed.
88 * @return $this (fluent interface)
89 * @api
90 */
91 public function setRespectSysLanguage($respectSysLanguage) {
92 $this->respectSysLanguage = $respectSysLanguage;
93 return $this;
94 }
95
96 /**
97 * Returns the state, if a and language overlay should be performed.
98 *
99 * @return boolean TRUE, if a and language overlay should be performed; otherwise FALSE.
100 */
101 public function getRespectSysLanguage() {
102 return $this->respectSysLanguage;
103 }
104
105 /**
106 * Sets the flag if the visibility in the frontend should be respected.
107 *
108 * @param $respectEnableFields TRUE if the visibility in the frontend should be respected. If TRUE, the "enable fields" of TYPO3 will be added to the query statement.
109 * @return $this (fluent interface)
110 * @api
111 */
112 public function setRespectEnableFields($respectEnableFields) {
113 $this->respectEnableFields = $respectEnableFields;
114 return $this;
115 }
116
117 /**
118 * Returns the state, if the visibility settings for the frontend should be respected for the query.
119 *
120 * @return boolean TRUE, if the visibility settings for the frontend should should be respected; otherwise FALSE.
121 */
122 public function getRespectEnableFields() {
123 return $this->respectEnableFields;
124 }
125
126 /**
127 * Sets the state, if the QueryResult should be returned unmapped.
128 *
129 * @var boolean $returnRawQueryResult TRUE, if the QueryResult should be returned unmapped; otherwise FALSE.
130 * @return void
131 */
132 public function setReturnRawQueryResult($returnRawQueryResult) {
133 $this->returnRawQueryResult = $returnRawQueryResult;
134 }
135
136 /**
137 * Returns the state, if the QueryResult should be returned unmapped.
138 *
139 * @return boolean TRUE, if the QueryResult should be returned unmapped; otherwise FALSE.
140 */
141 public function getReturnRawQueryResult() {
142 return $this->returnRawQueryResult;
143 }
144
145 }
146 ?>