Files
thetool/application/Api/v1/Modules/ApiControllerModule.php
2024-01-05 19:29:06 +01:00

35 lines
715 B
PHP

<?php
namespace application\Api\v1\Modules;
class ApiControllerModule {
protected $log;
private $dependencies = [];
public function __construct($dependencies = null) {
$this->log = \mfLoghandler::singleton();
if(is_array($dependencies) && count($dependencies)) {
foreach($dependencies as $name => $dep) {
$this->$name = $dep;
}
}
if(method_exists($this, "init")) {
$this->init();
}
}
public function __get($name) {
if(array_key_exists($name, $this->dependencies)) {
return $this->dependencies[$name];
}
return null;
}
public function __set($name, $value) {
$this->dependencies[$name] = $value;
return true;
}
}