/** * Gets the discussion from the update marked with "for update" to ensure that position * counters are maintained correctly. * * @return array|false */ public function getDiscussionForUpdate() { if ($this->isUpdate()) { return $this->_discussionDefinition->getDiscussionForUpdate($this->_db, $this->getDiscussionId()); } else { return false; } }
/** * Updates the value of the last post for this discussion. */ public function updateLastPost() { $lastPost = $this->_getLastMessageInDiscussion(); if ($lastPost) { $messageStructure = $this->_messageDefinition->getMessageStructure(); $this->set('last_post_id', $lastPost[$messageStructure['key']]); $this->set('last_post_date', $lastPost['post_date']); $this->set('last_post_user_id', $lastPost['user_id']); $this->set('last_post_username', $lastPost['username']); } else { $this->set('last_post_id', $this->get('first_post_id')); $this->set('last_post_date', $this->get('post_date')); $this->set('last_post_user_id', $this->get('user_id')); $this->set('last_post_username', $this->get('username')); } }
/** * Gets the content type for tables that contain multiple data types together. * * @return string */ public function getContentType() { return $this->_messageDefinition->getContentType(); }