public function update(array $data = []) { if (count($data) === 0) { throw new ModelException('Not valid columns found to update.'); } $this->query->update($data); return $this->model; }