Author: Grzegorz Kuźnik
Inheritance: extends File
Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
 /**
  * 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;
 }