[!!!][~API] Extbase (Persistence): $query->execute() now returns a plain array of...
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / QOM / QueryObjectModelInterface.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 * A query in the JCR query object model.
30 *
31 * The JCR query object model describes the queries that can be evaluated by a JCR
32 * repository independent of any particular query language, such as SQL.
33 *
34 * A query consists of:
35 *
36 * a source. When the query is evaluated, the source evaluates its selectors and
37 * the joins between them to produce a (possibly empty) set of node-tuples. This
38 * is a set of 1-tuples if the query has one selector (and therefore no joins), a
39 * set of 2-tuples if the query has two selectors (and therefore one join), a set
40 * of 3-tuples if the query has three selectors (two joins), and so forth.
41 * an optional constraint. When the query is evaluated, the constraint filters the
42 * set of node-tuples.
43 * a list of zero or more orderings. The orderings specify the order in which the
44 * node-tuples appear in the query results. The relative order of two node-tuples
45 * is determined by evaluating the specified orderings, in list order, until
46 * encountering an ordering for which one node-tuple precedes the other. If no
47 * orderings are specified, or if for none of the specified orderings does one
48 * node-tuple precede the other, then the relative order of the node-tuples is
49 * implementation determined (and may be arbitrary).
50 * a list of zero or more columns to include in the tabular view of the query
51 * results. If no columns are specified, the columns available in the tabular view
52 * are implementation determined, but minimally include, for each selector, a column
53 * for each single-valued non-residual property of the selector's node type.
54 *
55 * The query object model representation of a query is created by factory methods in the QueryObjectModelFactory.
56 *
57 * @package Extbase
58 * @subpackage Persistence\QOM
59 * @version $Id$
60 */
61 interface Tx_Extbase_Persistence_QOM_QueryObjectModelInterface {
62
63 /**
64 * Flags determining the language of the query
65 */
66 const JCR_JQOM = 'JCR-JQOM';
67 const TYPO3_SQL_MYSQL = 'TYPO3-SQL-MYSQL';
68
69 /**
70 * Gets the node-tuple source for this query.
71 *
72 * @return Tx_Extbase_Persistence_QOM_SourceInterface the node-tuple source; non-null
73 */
74 public function getSource();
75
76 /**
77 * Gets the constraint for this query.
78 *
79 * @return Tx_Extbase_Persistence_QOM_ConstraintInterface the constraint, or null if none
80 */
81 public function getConstraint();
82
83 /**
84 * Gets the orderings for this query.
85 *
86 * @return array an array of zero or more Tx_Extbase_Persistence_QOM_OrderingInterface; non-null
87 */
88 public function getOrderings();
89
90 /**
91 * Gets the columns for this query.
92 *
93 * @return array an array of zero or more Tx_Extbase_Persistence_QOM_ColumnInterface; non-null
94 */
95 public function getColumns();
96
97 /**
98 * Backend specific query settings
99 *
100 * @return Tx_Extbase_Persistence_Storage_QuerySettingsInterface Backend specific query settings
101 */
102 public function getQuerySettings();
103
104 /**
105 * Binds the given value to the variable named $varName.
106 *
107 * @param string $varName name of variable in query
108 * @param Tx_Extbase_Persistence_ValueInterface $value value to bind
109 * @return void
110 * @throws InvalidArgumentException if $varName is not a valid variable in this query.
111 * @throws RepositoryException if an error occurs.
112 */
113 public function bindValue($varName, Tx_Extbase_Persistence_ValueInterface $value);
114
115 }
116
117 ?>