Пример #1
0
 function &formBackingObject(&$request)
 {
     $post_id = RequestUtils::getPathWithinHandlerMapping();
     if (is_null($post_id) || $post_id == '') {
         show_error('EditPost', 'No post id specified.');
     }
     $post = $this->postDAO->getPostById($post_id);
     if (is_null($post)) {
         show_error('EditPost', 'Post not found.');
     }
     return $post;
 }
Пример #2
0
 function &handleRequestInternal(&$request, &$response)
 {
     $post_id = RequestUtils::getPathWithinHandlerMapping();
     if (is_null($post_id) || $post_id == '') {
         show_error('DeletePost', 'No post id specified.');
     }
     $post = new Post();
     $post->id = $post_id;
     $this->postDAO->deletePost($post);
     $mv = new ModelAndView($this->successView);
     return $mv;
 }