/** * Delete the record and all associated data * * @return boolean False if error, True on success */ public function delete() { // Can't delete what doesn't exist if (!$this->exists()) { return true; } // Adjust credits $this->adjustCredits(); // Remove comments foreach ($this->comments('list', array('filterby' => 'all')) as $comment) { if (!$comment->delete()) { $this->setError($comment->getError()); return false; } } // Remove all tags $this->tag(''); // Attempt to delete the record return parent::delete(); }
/** * Delete the record and all associated data * * @return boolean False if error, True on success */ public function delete() { // Can't delete what doesn't exist if (!$this->exists()) { return true; } // Remove comments foreach ($this->replies('list') as $comment) { if (!$comment->delete()) { $this->setError($comment->getError()); return false; } } // Clear the history of "helpful" clicks $al = new Tables\Log($this->_db); if (!$al->deleteLog($this->get('id'))) { $this->setError($al->getError()); return false; } return parent::delete(); }
/** * Delete the record and all associated data * * @return boolean False if error, True on success */ public function delete() { // Can't delete what doesn't exist if (!$this->exists()) { return true; } // Remove comments foreach ($this->replies('list') as $comment) { if (!$comment->delete()) { $this->setError($comment->getError()); return false; } } return parent::delete(); }