7e0188afe15f4264dec325e974dee76310068603
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Object / ObjectManagerInterface.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Object;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Interface for the TYPO3 Object Manager
19 */
20 interface ObjectManagerInterface extends \TYPO3\CMS\Core\SingletonInterface
21 {
22 /**
23 * Returns TRUE if an object with the given name is registered
24 *
25 * @param string $objectName Name of the object
26 * @return bool TRUE if the object has been registered, otherwise FALSE
27 * @internal only to be used within Extbase, not part of TYPO3 Core API.
28 */
29 public function isRegistered($objectName);
30
31 /**
32 * Returns a fresh or existing instance of the object specified by $objectName.
33 *
34 * @param string $objectName The name of the object to return an instance of
35 * @param array ...$constructorArguments
36 * @return object The object instance
37 */
38 public function get($objectName, ...$constructorArguments);
39
40 /**
41 * Create an instance of $className without calling its constructor
42 *
43 * @param string $className
44 * @return object
45 */
46 public function getEmptyObject($className);
47
48 /**
49 * Returns the scope of the specified object.
50 *
51 * @param string $objectName The object name
52 * @return int One of the Container::SCOPE_ constants
53 * @internal only to be used within Extbase, not part of TYPO3 Core API.
54 */
55 public function getScope($objectName);
56 }