Exemplo n.º 1
0
 protected function deleteSitemapDocument($id)
 {
     $sitemapInfo = Sitemap_Sample::get($id);
     if (empty($sitemapInfo)) {
         throw new NotFoundException('Sitemap with id=' . $id . ' not found');
     }
     $isEditable = ModelHelper::isEditable($sitemapInfo['document_name']);
     if ($isEditable) {
         Sitemap::remove($id);
     }
 }
Exemplo n.º 2
0
 /**
  * (non-PHPdoc)
  * @see parent::delete()
  */
 public function delete()
 {
     // store current id
     $id = $this->getId();
     if ($this->withSitemap) {
         try {
             $this->needSitemapData();
             // Вызываем удаление
             $aChild = Sitemap_Sample::selectChild($this->sitemapInfo['id']);
             foreach ($aChild as $row) {
                 Sitemap::remove($row['id']);
             }
         } catch (SiteMapException $e) {
         }
     }
     $result = parent::delete();
     if ($this->withSitemap) {
         try {
             Sitemap::remove($this->sitemapInfo['id']);
         } catch (SitemapException $e) {
         }
     }
     // Удаляем данные
     return $result;
 }