/** * Inittiert Objekt mit Daten aus der Datenbank, sofern ID vergeben wurde */ protected function init() { $data = $this->dbcon->fetch($this->dbcon->select($this->table, '*', "id = ?", array($this->id))); if (!$data) { trigger_error('Failed to load data for object of type "' . get_class($this) . '" with given id ' . $this->id . '!'); return false; } $this->objExists = true; foreach ($data as $key => $value) { $this->{$key} = $value; } }
/** * Inittiert Objekt mit Daten aus der Datenbank, sofern ID vergeben wurde */ protected function init() { $data = $this->dbcon->fetch($this->dbcon->select($this->table, '*', "modkey " . $this->dbcon->dbLike() . " ?", array($this->modkey))); if (!$data) { return false; } $this->objExists = true; $this->isInstalled = true; foreach ($data as $key => $value) { $this->{$key} = $value; } }
/** * Initialisiert */ protected function init() { $res = $this->dbcon->fetch($this->dbcon->select($this->table, 'lastexec, execinterval', 'cjname ' . $this->dbcon->dbLike() . ' ?', array($this->cronName))); $this->lastExecTime = isset($res->lastexec) ? $res->lastexec : 0; }