1 <?php
2
3 /* --------------------------------------------------------------
4 CrossCuttingLoaderInterface.inc.php 2015-07-22 gm
5 Gambio GmbH
6 http://www.gambio.de
7 Copyright (c) 2015 Gambio GmbH
8 Released under the GNU General Public License (Version 2)
9 [http://www.gnu.org/licenses/gpl-2.0.html]
10 --------------------------------------------------------------
11 */
12
13
14 /**
15 * Interface CrossCuttingLoaderInterface
16 *
17 * @category System
18 * @package Loaders
19 * @subpackage Interfaces
20 */
21 interface CrossCuttingLoaderInterface
22 {
23 /**
24 * In strict mode ($strictModeEnabled=true) this method accepts classes with implemented
25 * CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.
26 *
27 * @param string $p_classname
28 *
29 * @return object
30 * @throws InvalidArgumentException
31 */
32 public function getObject($p_classname);
33
34
35 /**
36 * If RegisteredObjectsOnly is enabled, the loader returns only objects, that were registered by
37 * the registerObject method before. RegisteredObjectsOnly should be enabled in all unit tests.
38 *
39 * @param boolean $bool_status
40 */
41 public function setRegisteredObjectsOnly($bool_status);
42
43
44 /**
45 * @return boolean
46 */
47 public function useRegisteredObjectsOnly();
48
49
50 /**
51 * In strict mode ($strictModeEnabled=true) this method accepts classes with implemented
52 * CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.
53 *
54 * @param string $p_classname
55 * @param object $object
56 *
57 * @throws InvalidArgumentException
58 */
59 public function registerObject($p_classname, $object);
60
61
62 /**
63 * @return void
64 */
65 public function clearRegister();
66 }