/** * Deletes all comments of the given post * * @param Tx_BlogExample_Domain_Model_Post $post The post the comment is related to * @return void */ public function deleteAllAction(Tx_BlogExample_Domain_Model_Post $post) { // TODO access protection $post->removeAllComments(); $this->addFlashMessage('deletedAll', t3lib_FlashMessage::INFO); $this->redirect('edit', 'Post', NULL, array('post' => $post, 'blog' => $post->getBlog())); }
/** * Finds the post next to the given post * * @param Tx_BlogExample_Domain_Model_Post $post The reference post * @return Tx_BlogExample_Domain_Model_Post */ public function findNext(Tx_BlogExample_Domain_Model_Post $post) { $query = $this->createQuery(); return $query->matching($query->greaterThan('date', $post->getDate()))->execute()->getFirst(); }