[TASK] Sync persistence folder scheme with FLOW3
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / 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_QuerySettingsInterface {
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 * the pid(s) of the storage page(s) that should be respected for the query.
47 * @var array
48 */
49 protected $storagePageIds = array();
50
51 /**
52 * Flag if the visibility settings for the frontend should be respected.
53 * @var boolean
54 */
55 protected $respectEnableFields = TRUE;
56
57 /**
58 * Flag if the sys_language_uid should be respected (default is TRUE).
59 * @var boolean
60 */
61 protected $respectSysLanguage = TRUE;
62
63 /**
64 * Flag if the the query result should be returned as raw QueryResult.
65 * @var boolean
66 */
67 protected $returnRawQueryResult = FALSE;
68
69 /**
70 * Sets the flag if the storage page should be respected for the query.
71 *
72 * @param $respectStoragePage If TRUE the storage page ID will be determined and the statement will be extended accordingly.
73 * @return $this (fluent interface)
74 * @api
75 */
76 public function setRespectStoragePage($respectStoragePage) {
77 $this->respectStoragePage = $respectStoragePage;
78 return $this;
79 }
80
81 /**
82 * Returns the state, if the storage page should be respected for the query.
83 *
84 * @return boolean TRUE, if the storage page should be respected; otherwise FALSE.
85 */
86 public function getRespectStoragePage() {
87 return $this->respectStoragePage;
88 }
89
90 /**
91 * Sets the pid(s) of the storage page(s) that should be respected for the query.
92 *
93 * @param array $respectStoragePage If TRUE the storage page ID will be determined and the statement will be extended accordingly.
94 * @return Tx_Extbase_Persistence_QuerySettingsInterface instance of $this to allow method chaining
95 * @api
96 */
97 public function setStoragePageIds(array $storagePageIds) {
98 $this->storagePageIds = $storagePageIds;
99 }
100
101 /**
102 * Returns the pid(s) of the storage page(s) that should be respected for the query.
103 *
104 * @return array list of integers that each represent a storage page id
105 */
106 public function getStoragePageIds() {
107 return $this->storagePageIds;
108 }
109
110 /**
111 * Sets the flag if a and language overlay should be performed.
112 *
113 * @param $respectEnableFields TRUE if a and language overlay should be performed.
114 * @return $this (fluent interface)
115 * @api
116 */
117 public function setRespectSysLanguage($respectSysLanguage) {
118 $this->respectSysLanguage = $respectSysLanguage;
119 return $this;
120 }
121
122 /**
123 * Returns the state, if a and language overlay should be performed.
124 *
125 * @return boolean TRUE, if a and language overlay should be performed; otherwise FALSE.
126 */
127 public function getRespectSysLanguage() {
128 return $this->respectSysLanguage;
129 }
130
131 /**
132 * Sets the flag if the visibility in the frontend should be respected.
133 *
134 * @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.
135 * @return $this (fluent interface)
136 * @api
137 */
138 public function setRespectEnableFields($respectEnableFields) {
139 $this->respectEnableFields = $respectEnableFields;
140 return $this;
141 }
142
143 /**
144 * Returns the state, if the visibility settings for the frontend should be respected for the query.
145 *
146 * @return boolean TRUE, if the visibility settings for the frontend should should be respected; otherwise FALSE.
147 */
148 public function getRespectEnableFields() {
149 return $this->respectEnableFields;
150 }
151
152 /**
153 * Sets the state, if the QueryResult should be returned unmapped.
154 *
155 * @var boolean $returnRawQueryResult TRUE, if the QueryResult should be returned unmapped; otherwise FALSE.
156 * @return void
157 */
158 public function setReturnRawQueryResult($returnRawQueryResult) {
159 $this->returnRawQueryResult = $returnRawQueryResult;
160 }
161
162 /**
163 * Returns the state, if the QueryResult should be returned unmapped.
164 *
165 * @return boolean TRUE, if the QueryResult should be returned unmapped; otherwise FALSE.
166 */
167 public function getReturnRawQueryResult() {
168 return $this->returnRawQueryResult;
169 }
170
171 }
172 ?>