Example #1
0
 /**
  * Обновляет блог
  *
  * @param ModuleBlog_EntityBlog $oBlog	Блог
  * @return ModuleBlog_EntityBlog|bool
  */
 public function UpdateBlog(ModuleBlog_EntityBlog $oBlog)
 {
     $oBlog->setDateEdit(date("Y-m-d H:i:s"));
     $res = $this->oMapperBlog->UpdateBlog($oBlog);
     if ($res) {
         //чистим зависимые кеши
         $this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('blog_update', "blog_update_{$oBlog->getId()}", "topic_update"));
         $this->Cache_Delete("blog_{$oBlog->getId()}");
         return true;
     }
     return false;
 }
Example #2
0
 /**
  * Обновляет блог
  *
  * @param ModuleBlog_EntityBlog $oBlog    Блог
  *
  * @return ModuleBlog_EntityBlog|bool
  */
 public function UpdateBlog(ModuleBlog_EntityBlog $oBlog)
 {
     $oBlog->setDateEdit(F::Now());
     $bResult = $this->oMapper->UpdateBlog($oBlog);
     if ($bResult) {
         $aTags = array('blog_update', "blog_update_{$oBlog->getId()}", 'topic_update');
         if ($oBlog->getOldType() && $oBlog->getOldType() != $oBlog->getType()) {
             // Списк авторов блога
             $aUsersId = $this->GetAuthorsIdByBlog($oBlog->GetId());
             foreach ($aUsersId as $nUserId) {
                 $aTags[] = 'topic_update_user_' . $nUserId;
             }
         }
         //чистим зависимые кеши
         E::ModuleCache()->CleanByTags($aTags);
         E::ModuleCache()->Delete("blog_{$oBlog->getId()}");
         return true;
     }
     return false;
 }