Exemplo n.º 1
0
 /**
  * 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);
 }
Exemplo n.º 2
0
 public static function getById($id)
 {
     $data = parent::getById($id);
     $data = json_decode($data, true);
     $entity = self::getNewEntity($data['type']);
     $entity->__construct($data);
     return $entity;
 }
Exemplo n.º 3
0
 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');
 }
Exemplo n.º 4
0
 /**
  * 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();
 }
Exemplo n.º 5
0
 /**
  * Destructor.
  *
  * @api
  */
 public function __destruct()
 {
     parent::__destruct();
 }
Exemplo n.º 6
0
 public function __destruct()
 {
     $this->sync();
     if ($this->dir->exists()) {
         TTL::queued($this->name, $this->ttl);
     }
     parent::__destruct();
 }