/** * Get the revision object for $this->mRevisionId * * @return Revision|null Either a Revision object or null * @since 1.23 (public since 1.23) */ public function getRevisionObject() { if (!is_null($this->mRevisionObject)) { return $this->mRevisionObject; } if (is_null($this->mRevisionId)) { return null; } $rev = call_user_func($this->mOptions->getCurrentRevisionCallback(), $this->getTitle(), $this); # If the parse is for a new revision, then the callback should have # already been set to force the object and should match mRevisionId. # If not, try to fetch by mRevisionId for sanity. if ($rev && $rev->getId() != $this->mRevisionId) { $rev = Revision::newFromId($this->mRevisionId); } $this->mRevisionObject = $rev; return $this->mRevisionObject; }