public static function table($name)
{
$file = new Data();
$file->name = $name;
$file->setType('data');
return $file;
}
/** * 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; }