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 / QOM / Selector.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 * Selects a subset of the nodes in the repository based on node type.
30 *
31 * A selector selects every node in the repository, subject to access control
32 * constraints, that satisfies at least one of the following conditions:
33 *
34 * the node's primary node type is nodeType, or
35 * the node's primary node type is a subtype of nodeType, or
36 * the node has a mixin node type that is nodeType, or
37 * the node has a mixin node type that is a subtype of nodeType.
38 *
39 * @package Extbase
40 * @subpackage Persistence\QOM
41 * @version $Id: Selector.php 1729 2009-11-25 21:37:20Z stucki $
42 * @scope prototype
43 */
44 class Tx_Extbase_Persistence_QOM_Selector implements Tx_Extbase_Persistence_QOM_SelectorInterface {
45
46 /**
47 * @var string
48 */
49 protected $nodeTypeName;
50
51 /**
52 * @var string
53 */
54 protected $selectorName;
55
56 /**
57 * Constructs the Selector instance
58 *
59 * @param string $selectorName
60 * @param string $nodeTypeName
61 */
62 public function __construct($selectorName, $nodeTypeName) {
63 $this->selectorName = $selectorName;
64 $this->nodeTypeName = $nodeTypeName;
65 }
66
67 /**
68 * Gets the name of the required node type.
69 *
70 * @return string the node type name; non-null
71 */
72 public function getNodeTypeName() {
73 return $this->nodeTypeName;
74 }
75
76 /**
77 * Gets the selector name.
78 * A selector's name can be used elsewhere in the query to identify the selector.
79 *
80 * @return the selector name; non-null
81 */
82 public function getSelectorName() {
83 return $this->selectorName;
84 }
85
86 }
87
88 ?>