Add Extbase 1.0.1 to TYPO3core. Do NOT make changes inside! See misc/core_svn_rules...
[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: Typo3QuerySettings.php 1729 2009-11-25 21:37:20Z stucki $
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 the query result should be returned as raw QueryResult.
53 * @var boolean
54 */
55 protected $returnRawQueryResult = FALSE;
56
57 /**
58 * Sets the flag if the storage page should be respected for the query.
59 *
60 * @param $respectStoragePage If TRUE the storage page ID will be determined and the statement will be extended accordingly.
61 * @return $this (fluent interface)
62 * @api
63 */
64 public function setRespectStoragePage($respectStoragePage) {
65 $this->respectStoragePage = $respectStoragePage;
66 return this;
67 }
68
69 /**
70 * Returns the state, if the storage page should be respected for the query.
71 *
72 * @return boolean TRUE, if the storage page should be respected; otherwise FALSE.
73 */
74 public function getRespectStoragePage() {
75 return $this->respectStoragePage;
76 }
77
78 /**
79 * Sets the flag if the visibility in the frontend should be respected.
80 *
81 * @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.
82 * @return $this (fluent interface)
83 * @api
84 */
85 public function setRespectEnableFields($respectEnableFields) {
86 $this->respectEnableFields = $respectEnableFields;
87 return this;
88 }
89
90 /**
91 * Returns the state, if the visibility settings for the frontend should be respected for the query.
92 *
93 * @return boolean TRUE, if the visibility settings for the frontend should should be respected; otherwise FALSE.
94 */
95 public function getRespectEnableFields() {
96 return $this->respectEnableFields;
97 }
98
99 /**
100 * Sets the state, if the QueryResult should be returned unmapped.
101 *
102 * @var boolean $returnRawQueryResult TRUE, if the QueryResult should be returned unmapped; otherwise FALSE.
103 * @return void
104 */
105 public function setReturnRawQueryResult($returnRawQueryResult) {
106 $this->returnRawQueryResult = $returnRawQueryResult;
107 }
108
109 /**
110 * Returns the state, if the QueryResult should be returned unmapped.
111 *
112 * @return boolean TRUE, if the QueryResult should be returned unmapped; otherwise FALSE.
113 */
114 public function getReturnRawQueryResult() {
115 return $this->returnRawQueryResult;
116 }
117
118 }
119 ?>