/** * Deleting loaded data * @return boolean */ public function delete() { $data = $this->getData(); if (isset($this->currentId)) { unset($data[$this->currentKey]); } else { $this->pending(); $old = $data; $data = array_diff_key($old, $this->data); } $this->data = array_values($data); return Helpers\Data::table($this->name)->put($this->data) ? true : false; }
/** * Checking that Table and Config exists and throw exceptions if not * @return boolean * @throws LazerException */ public function exists() { if (!Data::table($this->name)->exists()) { throw new LazerException('Table "' . $this->name . '" does not exists'); } if (!Config::table($this->name)->exists()) { throw new LazerException('Config "' . $this->name . '" does not exists'); } return TRUE; }