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); }
/** * Проверяет существование документа * * @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'); }
/** * @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'); } }