Merge "[~CLEANUP] apply naming convention for flexForms"
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Object / Container / ClassInfo.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010 Extbase Team
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 * Value object containing the relevant informations for a class,
29 * this object is build by the classInfoFactory - or could also be restored from a cache
30 *
31 * @author Daniel Pötzinger
32 */
33 class Tx_Extbase_Object_Container_ClassInfo {
34
35 /**
36 * The classname of the class where the infos belong to
37 * @var string
38 */
39 private $className;
40
41 /**
42 * The constructor Dependencies for the class in the format:
43 * array(
44 * 0 => array( <-- parameters for argument 1
45 * 'name' => <arg name>, <-- name of argument
46 * 'dependency' => <classname>, <-- if the argument is a class, the type of the argument
47 * 'defaultvalue' => <mixed>) <-- if the argument is optional, its default value
48 * ),
49 * 1 => ...
50 * )
51 *
52 * @var array
53 */
54 private $constructorArguments;
55
56 /**
57 * All setter injections in the format
58 * array (<nameOfMethod> => <classNameToInject> )
59 *
60 * @var array
61 */
62 private $injectMethods;
63
64 /**
65 * Indicates if the class is a singleton or not.
66 *
67 * @var boolean
68 */
69 private $isSingleton = false;
70
71 /**
72 * Indicates if the class has the method initializeObject
73 *
74 * @var boolean
75 */
76 private $isInitializeable = false;
77
78 /**
79 *
80 * @param string $className
81 * @param array $constructorArguments
82 * @param array $injectMethods
83 * @param boolean $isSingleton
84 * @param boolean $isInitializeable
85 */
86 public function __construct($className, array $constructorArguments, array $injectMethods, $isSingleton = false, $isInitializeable = false) {
87 $this->className = $className;
88 $this->constructorArguments = $constructorArguments;
89 $this->injectMethods = $injectMethods;
90 $this->isSingleton = $isSingleton;
91 $this->isInitializeable = $isInitializeable;
92 }
93
94 /**
95 * @return the $className
96 */
97 public function getClassName() {
98 return $this->className;
99 }
100
101 /**
102 * @return the $constructorArguments
103 */
104 public function getConstructorArguments() {
105 return $this->constructorArguments;
106 }
107
108 /**
109 * Returns an array with the inject methods.
110 *
111 * @return the $injectMethods
112 */
113 public function getInjectMethods() {
114 return $this->injectMethods;
115 }
116
117 /**
118 * Returns if the class is a singleton or not.
119 *
120 * @return boolean
121 */
122 public function getIsSingleton() {
123 return $this->isSingleton;
124 }
125
126 /**
127 * Returns if the class is initializeable with initializeObject.
128 *
129 * @return boolean
130 */
131 public function getIsInitializeable() {
132 return $this->isInitializeable;
133 }
134
135 /**
136 * @return the $injectMethods
137 */
138 public function hasInjectMethods() {
139 return (count($this->injectMethods) > 0);
140 }
141 }