/** * Method that permits to update a comment * * @access private */ private function update() { $action_return = array(); if (VPost::submit() == 'Update Comment') { $comment = new Comment(); $comment->_id = VPost::comment_id(); $comment->_name = VPost::comment_name(); $comment->_email = VPost::comment_email(); $comment->_content = VPost::comment_content(); $comment->_status = VPost::comment_status(); try { $comment->update('_name', 'str'); $comment->update('_email', 'str'); $comment->update('_content', 'str'); $comment->update('_status', 'str'); array_push($action_return, true); } catch (Exception $e) { array_push($action_return, false); } } elseif ((VGet::action() || VPost::apply_action(false)) && in_array(VRequest::action(), $this->_actions) && VRequest::comment_id()) { if (VPost::apply_action(false)) { foreach (VPost::comment_id() as $id) { try { $comment = new Comment(); $comment->_id = $id; $comment->_status = $this->_action_value[VPost::action()]; $comment->update('_status', 'str'); unset($comment); array_push($action_return, true); } catch (Exception $e) { array_push($action_return, false); } } } else { try { $comment = new Comment(); $comment->_id = VGet::comment_id(); $comment->_status = $this->_action_value[VGet::action()]; $comment->update('_status', 'str'); unset($comment); array_push($action_return, true); } catch (Exception $e) { array_push($action_return, false); } } } if (!empty($action_return)) { $this->_action_msg = ActionMessages::update_comment($action_return); } }