1 | <?php |
||
12 | trait ConfigurableTrait |
||
13 | { |
||
14 | /** |
||
15 | * The config object. |
||
16 | * |
||
17 | * @var ConfigInterface |
||
18 | */ |
||
19 | private $config; |
||
20 | |||
21 | /** |
||
22 | * Sets the object's configuration container. |
||
23 | * |
||
24 | * @param mixed $config The Config object, datamap, or filepath. |
||
25 | * @throws InvalidArgumentException If the parameter is invalid. |
||
26 | * @return self Chainable |
||
27 | */ |
||
28 | public function setConfig($config) |
||
46 | |||
47 | /** |
||
48 | * Gets the object's configuration container or a specific key from the container. |
||
49 | * |
||
50 | * @param string|null $key If provided, the data key to retrieve. |
||
51 | * @param mixed $default The fallback value to return if $key does not exist. |
||
52 | * @return mixed If $key is NULL, the Config object is returned. |
||
53 | * If $key is given, its value on the Config object is returned. |
||
54 | * If the value of $key is NULL, the value of $default is returned. |
||
55 | */ |
||
56 | public function config($key = null, $default = null) |
||
74 | |||
75 | /** |
||
76 | * Create a new ConfigInterface instance for the object. |
||
77 | * |
||
78 | * @see AbstractConfig |
||
79 | * @param mixed $data Initial data. Either a filepath, a datamap, or a Config object. |
||
80 | * @return ConfigInterface A new Config object. |
||
81 | */ |
||
82 | protected function createConfig($data = null) |
||
86 | } |
||
87 |