public function delete() { $this->beforeDelete(); $ok = (bool) DB::delete($this->table, $this->getIdCondition()); return $this->id ? $this->afterDelete() : false; }