bookmark() public méthode

Bookmark (or unbookmark) a conversation for a specific user id.
Since: 2.0.0
public bookmark ( integer $ConversationID, integer $UserID ) : boolean
$ConversationID integer Unique ID of conversation effected.
$UserID integer Unique ID of current user.
Résultat boolean Whether it is currently bookmarked.
 /**
  * Allows users to bookmark conversations.
  *
  * @param int $ConversationID Unique ID of conversation to view.
  * @param string $TransientKey Single-use hash to prove intent.
  */
 public function bookmark($ConversationID = '', $TransientKey = '')
 {
     $Session = Gdn::session();
     $Bookmark = null;
     // Validate & do bookmarking.
     if (is_numeric($ConversationID) && $ConversationID > 0 && $Session->UserID > 0 && $Session->validateTransientKey($TransientKey)) {
         $Bookmark = $this->ConversationModel->bookmark($ConversationID, $Session->UserID);
     }
     // Report success or error
     if ($Bookmark === false) {
         $this->Form->addError('ErrorBool');
     } else {
         $this->setJson('Bookmark', $Bookmark);
     }
     // Redirect back where the user came from if necessary
     if ($this->_DeliveryType == DELIVERY_TYPE_ALL) {
         redirect($_SERVER['HTTP_REFERER']);
     } else {
         $this->render();
     }
 }