1<?php
2namespace 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 * @template T
21 */
22interface ObjectManagerInterface extends \TYPO3\CMS\Core\SingletonInterface
23{
24    /**
25     * Returns TRUE if an object with the given name is registered
26     *
27     * @param string $objectName Name of the object
28     * @return bool TRUE if the object has been registered, otherwise FALSE
29     * @internal only to be used within Extbase, not part of TYPO3 Core API.
30     */
31    public function isRegistered($objectName);
32
33    /**
34     * Returns a fresh or existing instance of the object specified by $objectName.
35     *
36     * @param string|class-string<T> $objectName The name of the object to return an instance of
37     * @param array ...$constructorArguments
38     * @return object&T The object instance
39     */
40    public function get($objectName, ...$constructorArguments);
41
42    /**
43     * Create an instance of $className without calling its constructor
44     *
45     * @param string|class-string<T> $className
46     * @return object&T
47     */
48    public function getEmptyObject($className);
49
50    /**
51     * Returns the scope of the specified object.
52     *
53     * @param string $objectName The object name
54     * @return int One of the Container::SCOPE_ constants
55     * @internal only to be used within Extbase, not part of TYPO3 Core API.
56     */
57    public function getScope($objectName);
58}
59