コード例 #1
0
 /**
  * Create a new object from a Revision ID and a wikia ID.  If the wikia ID does not
  * match the current wikia, this will make an external call to the wikia that
  * owns the data.
  *
  * @param int $revId The revision ID for this notification entity
  * @param int $wikiId The wiki where this revision exists
  * @param bool $useMasterDB Whether to query the MASTER DB on Title lookup.
  *
  * @return WallNotificationEntity|null
  */
 public static function createFromRevId($revId, $wikiId, $useMasterDB = false)
 {
     $wn = new WallNotificationEntity();
     if ($wikiId == F::app()->wg->CityId) {
         $success = $wn->loadDataFromRevId($revId, $useMasterDB);
     } else {
         $success = $wn->loadDataFromRevIdOnWiki($revId, $wikiId, $useMasterDB);
     }
     if ($success) {
         $wn->saveToCache();
         return $wn;
     }
     return null;
 }