function getCommentProperties($articleComment) { $properties = array(); if ($articleComment->getTitle()->getNamespace() == NS_USER_WALL_MESSAGE || $articleComment->getTitle()->getNamespace() == NS_WIKIA_FORUM_BOARD_THREAD) { $wallMessage = WallMessage::newFromArticleComment($articleComment); $properties = array('archived' => intval($wallMessage->isArchive()), 'deleted' => intval($wallMessage->isAdminDelete()), 'removed' => intval($wallMessage->isRemove())); } return $properties; }
/** * @return null|ArticleComment */ public function getTopParentObj() { wfProfileIn(__METHOD__); $key = $this->getArticleComment()->getTopParent(); if (!empty(self::$topObjectCache[$key])) { wfProfileOut(__METHOD__); return self::$topObjectCache[$key]; } $obj = $this->getArticleComment()->getTopParentObj(); if (empty($obj)) { wfProfileOut(__METHOD__); return null; } if ($obj instanceof ArticleComment) { wfProfileOut(__METHOD__); self::$topObjectCache[$key] = WallMessage::newFromArticleComment($obj); return self::$topObjectCache[$key]; } else { wfProfileOut(__METHOD__); return null; } }
protected function getWallMessage() { $comment = $this->request->getVal('comment'); if ($comment instanceof ArticleComment) { $wallMessage = WallMessage::newFromArticleComment($comment); } else { $wallMessage = $comment; } if ($wallMessage instanceof WallMessage) { $wallMessage->load(); return $wallMessage; } }