Files
thetool/application/Api/v1/Modules/ApiControllerModule.php

35 lines
708 B
PHP

<?php
namespace thetool\Api\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;
}
}