function getParentPage($articleComment) { $titleText = $articleComment->getTitle()->getDBkey(); $parts = explode('/@', $titleText); $titleText = $parts[0]; $namespace = MWNamespace::getSubject($articleComment->getTitle()->getNamespace()); $title = Title::newFromText($titleText, $namespace); if ($title instanceof Title) { // create message wall if not exist if (!$title->exists() && $namespace == NS_USER_WALL) { $title = WallMessage::addMessageWall($title); echo ".....Wall message NOT found.\n\tAdded wall message '{$titleText}' (" . $title->getArticleID() . ")"; return $title->getArticleId(); } } return $title->getArticleID(); }