1 | <?php |
||
18 | class ObjectHelper |
||
19 | { |
||
20 | /** |
||
21 | * Returns the public member variables of an object. |
||
22 | * |
||
23 | * @param ObjectInterface $object |
||
24 | * @return array |
||
25 | */ |
||
26 | public static function getObjectVars(ObjectInterface $object) |
||
30 | |||
31 | /** |
||
32 | * Configures an object with the initial property values. |
||
33 | * |
||
34 | * @param ObjectInterface $object |
||
35 | * @param $properties |
||
36 | * @return ObjectInterface |
||
37 | */ |
||
38 | public static function configure(ObjectInterface $object, $properties) |
||
55 | |||
56 | /** |
||
57 | * Create a new object |
||
58 | * |
||
59 | * @param $config |
||
60 | * @param null $instanceOf |
||
61 | * @return ObjectInterface |
||
62 | * @throws InvalidConfigurationException |
||
63 | */ |
||
64 | public static function create($config, $instanceOf = null) |
||
72 | |||
73 | /** |
||
74 | * Checks the config for a valid class |
||
75 | * |
||
76 | * @param $config |
||
77 | * @param null $instanceOf |
||
78 | * @param bool $removeClass |
||
79 | * @return null|string |
||
80 | * @throws InvalidConfigurationException |
||
81 | */ |
||
82 | public static function checkConfig(&$config, $instanceOf = null, $removeClass = true) |
||
100 | |||
101 | /** |
||
102 | * Get a class from a config |
||
103 | * |
||
104 | * @param $config |
||
105 | * @param bool $removeClass |
||
106 | * @return string |
||
107 | * @throws InvalidConfigurationException |
||
108 | */ |
||
109 | public static function getClassFromConfig(&$config, $removeClass = false) |
||
125 | |||
126 | /** |
||
127 | * Find a class from a config |
||
128 | * |
||
129 | * @param $config |
||
130 | * @param bool $removeClass |
||
131 | * @return null|string |
||
132 | */ |
||
133 | public static function findClassFromConfig(&$config, $removeClass = false) |
||
160 | } |
||
161 |