当前位置: 首页>>代码示例>>PHP>>正文


PHP Document::deleteObjCache方法代码示例

本文整理汇总了PHP中Document::deleteObjCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Document::deleteObjCache方法的具体用法?PHP Document::deleteObjCache怎么用?PHP Document::deleteObjCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Document的用法示例。


在下文中一共展示了Document::deleteObjCache方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         //deletes generic document
         $genericDocument = Document::getGenericDocument($this);
         $genericDocument->delete();
         //deletes any tags for this document
         $c = new Criteria();
         $c->add(TagrelationPeer::TAG_ID, $this->getId());
         $tagRelations = TagrelationPeer::doSelect($c);
         foreach ($tagRelations as $tag) {
             $tag->delete();
         }
         parent::delete();
         $con->commit();
         if (sfConfig::get('sf_cache_relations')) {
             Tagrelation::updateTagRelationCache();
         }
         Document::deleteObjCache($this);
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:27,代码来源:Tag.php

示例2: delete

 public function delete($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         Document::getGenericDocument($this)->delete();
         parent::delete();
         $con->commit();
         Document::deleteObjCache($this);
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:15,代码来源:News.php

示例3: delete

 public function delete($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         //deletes generic document
         $genericDocument = Document::getGenericDocument($this);
         $genericDocument->delete();
         parent::delete();
         $con->commit();
         Document::deleteObjCache($this);
         // remove list cache
         Lists::deleteListCache($this->getListId());
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:19,代码来源:Lists.php

示例4: deleteDocument

 public static function deleteDocument($id)
 {
     $con = Propel::getConnection(DocumentPeer::DATABASE_NAME);
     $stmt = $con->createStatement();
     $children = $medias = array();
     $medias = Document::getChildrenOf($id, "Media");
     if ($medias) {
         foreach ($medias as $media) {
             $media->delete();
         }
     }
     $children = Document::getChildrenOf($id, null, false);
     $sql = "DELETE FROM m_document WHERE m_document.id = {$id}";
     $stmt->executeQuery($sql);
     Document::deleteObjCache($id);
     foreach ($children as $child) {
         self::deleteDocument($child);
     }
 }
开发者ID:kotow,项目名称:work,代码行数:19,代码来源:Document.php

示例5: delete

 public function delete($con = null)
 {
     $file = $this->getServerAbsoluteUrl();
     $thumb = $this->getServerAbsoluteThumbUrl();
     $filedeleted = true;
     $thumbdeleted = true;
     if (file_exists($file)) {
         $filedeleted = unlink($file);
     }
     if (file_exists($thumb)) {
         $thumbdeleted = unlink($thumb);
     }
     if (!$filedeleted) {
         FileHelper::Log("\tError: file '" . $file . "' could not be deleted!");
     }
     try {
         $con = Propel::getConnection();
         $con->begin();
         //deletes generic document
         $genericDocument = Document::getGenericDocument($this);
         if ($genericDocument) {
             $genericDocument->delete();
         }
         $con->commit();
         Document::deleteObjCache($this);
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:31,代码来源:Media.php


注:本文中的Document::deleteObjCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。