Exemple #1
0
 public static function getParentsForDocument($document_name, $document_id, $nLimitId = 0)
 {
     $aInfo = Sitemap_Sample::getByDocumentId($document_name, $document_id);
     if (empty($aInfo)) {
         throw new Exception('Document not found (' . $document_name . ',' . $document_id . ')');
     }
     return self::getParents($aInfo['id'], $nLimitId);
 }
Exemple #2
0
 /**
  * Проверяет существование документа
  *
  * @param string $szDocument  имя документа
  * @param int    $nDocumentId индекс документа
  * @param bool   $bMustExists если true, то документ должен существовать
  */
 protected static function seekRegisteredDocumentById($szDocument, $nDocumentId, $bMustExists = true)
 {
     $aPage = Sitemap_Sample::getByDocumentId($szDocument, $nDocumentId);
     if (!empty($aPage) == $bMustExists) {
         return $aPage;
     }
     throw new SiteMapException('Search registered document failed');
 }
Exemple #3
0
 /**
  * @throws Exception
  */
 public function needSitemapData()
 {
     if (empty($this->sitemapInfo)) {
         $this->sitemapInfo = Sitemap_Sample::getByDocumentId(static::ModelName, $this->columns['id']->getValue());
     }
     if (empty($this->sitemapInfo)) {
         throw new Exception('Current document doesn`t have any sitemap data');
     }
 }