/** * Deletes any pet <=> color mappings for this color prior to deletion. * * @return bool **/ public function destroy() { $result = $this->db->query('DELETE FROM pet_specie_pet_specie_color WHERE pet_specie_color_id = ?', array($this->getPetSpecieColor())); if (PEAR::isError($result)) { throw new SQLError($result->getDebugInfo(), $result->userinfo, 10); } return parent::destroy(); }
/** * Delete a post and remove one from the user's postcount. * * Since this is called in a loop from BoardThead#destroy(), * I wrote the update SQL so it only has to do one query * instead of four. * * @ihatemysql * @return bool **/ public function destroy() { $result = $this->db->query('UPDATE user SET post_count = post_count - 1 WHERE user_id = ?', array($this->getUserId())); return parent::destroy(); }
/** * Delete a thread and its associated posts. * * @return bool **/ public function destroy() { $posts = $this->grabPosts(); foreach ($posts as $post) { $post->destroy(); } return parent::destroy(); }
/** * Delete a staff group and its permission mapping. * * @return bool **/ public function destroy() { $result = $this->db->query('DELETE FROM staff_group_staff_permission WHERE staff_group_id = ?', array($this->getStaffGroupId())); if (PEAR::isError($result)) { throw new SQLError($result->getDebugInfo(), $result->userinfo, 10); } return parent::destroy(); }