/** * Injects the \Stackable storage handler into the instance. * * @param string $identifier Unique identifier for the cache storage * * @return void */ public function __construct($identifier = null) { // inject the stackable storage $this->injectStorage(array()); // call the parent constructor to initialize + flush the storage parent::__construct($identifier); }
public static function getById($id) { $data = parent::getById($id); $data = json_decode($data, true); $entity = self::getNewEntity($data['type']); $entity->__construct($data); return $entity; }
function init() { parent::init(); //TODO may be assign tables in setSource $this->files = $this->api->db->dsql()->table('file'); $this->filespaces = $this->api->db->dsql()->table('filespace'); $this->filetypes = $this->api->db->dsql()->table('filetype'); $this->deleted_files = $this->api->db->dsql()->table('filedelnum'); }
/** * Constructor * @todo use global options */ public function __construct() { /*$di = \Centreon\Internal\Di::getDefault(); $dbconn = $di->get('db_centreon'); /* Get the path for rrd metrics and status * $query = "SELECT RRDdatabase_path, RRDdatabase_status_path FROM rt_configs WHERE id = 1"; $stmt = $dbconn->query($query); $row = $stmt->fetch(); $this->rrdPath = $row['RRDdatabase_path']; $this->rrdStatusPath = $row['RRDdatabase_status_path'];*/ $this->rrdPath = '/var/lib/centreon/metrics/'; $this->rrdStatusPath = '/var/lib/centreon/status/'; parent::__construct(); }
/** * Destructor. * * @api */ public function __destruct() { parent::__destruct(); }
public function __destruct() { $this->sync(); if ($this->dir->exists()) { TTL::queued($this->name, $this->ttl); } parent::__destruct(); }