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


PHP Document::cacheObj方法代码示例

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


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

示例1: save

 public function save($con = null, $parent = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         if (!$this->getId()) {
             $this->setId(Document::getGenericDocument($this)->getId());
         }
         parent::save($con);
         // create relationship
         if (!$parent && !Document::getParentOf($this->getId())) {
             $parent = Rootfolder::getRootfolder($this);
         }
         Relation::saveRelation($parent, $this);
         $con->commit();
         if (sfConfig::get('sf_cache_relations')) {
             Tagrelation::updateTagRelationCache();
         }
         Document::cacheObj($this, get_class($this));
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:25,代码来源:Tag.php

示例2: save

 public function save($con = null, $parent = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         if (!$this->getId()) {
             $genDoc = Document::getGenericDocument($this);
             $genDoc->setPublicationStatus("WAITING");
             $genDoc->save();
             $this->setId($genDoc->getId());
         }
         parent::save($con);
         // create relationship
         if (!$parent && !Document::getParentOf($this->getId())) {
             $parent = Rootfolder::getRootfolder($this);
         }
         Relation::saveRelation($parent, $this);
         $con->commit();
         Document::cacheObj($this, get_class($this));
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:25,代码来源:Newsletter.php

示例3: save

 public function save($con = null, $parent = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         if (!$this->getId()) {
             $this->setId(Document::getGenericDocument($this)->getId());
         }
         parent::save($con);
         // create relationship
         if (!$parent && !Document::getParentOf($this->getId())) {
             $parent = Rootfolder::getRootfolder($this);
         }
         Relation::saveRelation($parent, $this);
         $con->commit();
         Document::cacheObj($this, get_class($this));
         // get Lists object
         if (!$parent) {
             $parent = Document::getParentOf($this->getId());
         }
         // update list cache
         if (get_class($parent) == "Lists") {
             Lists::updateListCache($parent->getListId());
         }
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:30,代码来源:Listitem.php

示例4: save

 public function save($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         if (!$this->getId()) {
             $this->setId(Document::getGenericDocument($this)->getId());
         }
         parent::save($con);
         $con->commit();
         Document::cacheObj($this, get_class($this));
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:17,代码来源:Rootfolder.php

示例5: save

 public function save($con = null, $parent = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         if (trim($this->__toString()) != "") {
             $this->setLabel($this->__toString());
         }
         switch ($this->getType()) {
             case "admin":
                 //case "site_admin":
                 $this->setBackend(1);
                 break;
             default:
                 $this->setBackend(0);
         }
         if ($this->getLogin() == "") {
             $this->setLogin($this->getEmail());
         }
         if (!$this->getId()) {
             $this->setId(Document::getGenericDocument($this)->getId());
         }
         /*if (!$this->getPublicationStatus())
         		{
         			$this->setPublicationStatus(UtilsHelper::STATUS_ACTIVE);
         		}*/
         parent::save($con);
         // create relationship
         if (!$parent && !Document::getParentOf($this->getId())) {
             $parent = Rootfolder::getRootfolder($this);
         }
         Relation::saveRelation($parent, $this);
         $con->commit();
         Document::cacheObj($this, get_class($this));
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:40,代码来源:User.php

示例6: executeSetPublicationStatus

 public function executeSetPublicationStatus()
 {
     $items = explode(",", $this->getRequestParameter('items'));
     $status = $this->getRequestParameter('status');
     try {
         foreach ($items as $item) {
             $genericDocument = Document::getGenericDocument($item);
             $item = Document::getDocumentInstance($item);
             if ($genericDocument) {
                 $genericDocument->setPublicationStatus($status);
                 $genericDocument->save();
                 Document::cacheObj($item, null, true);
             }
         }
     } catch (Exception $e) {
         exit("A probleme occured: " . $e->getMessage());
     }
     exit("OK");
 }
开发者ID:kotow,项目名称:work,代码行数:19,代码来源:actions.class.php

示例7: run_generate_cache


//.........这里部分代码省略.........
                $obj['value'] = $cacheModel;
                $objects = array($obj);
                $exit = true;
            } else {
                $objects = XMLParser::getXMLdataValues(sfConfig::get('sf_root_dir') . "/config/cachedObjects.xml");
            }
            foreach ($objects as $obj) {
                if ($obj['tag'] == 'OBJECT' && $obj['type'] == 'complete') {
                    if ($id = $obj['id']) {
                        $obj = Document::getDocumentInstance($id);
                        $model = get_class($obj);
                        $c = new Criteria();
                        $c->add($tableName . '.ID', $id);
                    } else {
                        $model = $obj['value'];
                        $c = new Criteria();
                    }
                    $classPeer = ucfirst($model) . "Peer";
                    //$c = new Criteria();
                    //$results = call_user_func(array($classPeer, 'doSelect'), $c);
                    $peerMethod = "doSelect";
                    $results = call_user_func(array($classPeer, $peerMethod), $c);
                    echo_cms("  Caching " . $model . " documents");
                    $ind = 0;
                    foreach ($results as $result) {
                        if ($ind % 20 == 0) {
                            echo $ind . "  .\r";
                        } else {
                            if ($ind % 10 == 0) {
                                echo $ind . "  o\r";
                            }
                        }
                        $ind++;
                        Document::cacheObj($result, $model, false);
                    }
                    echo_cms(" ====> " . $ind . " " . $model . " Document(s) cached.");
                    //echo_cms_sep();
                }
            }
            if ($exit) {
                exit;
            }
        } catch (Expection $e) {
            echo_cms_error(" Error: {$e}");
        }
    }
    if (!$listsFlag) {
        echo "\n";
        //echo_cms_sep();
        echo_cms("Writing relations cache");
        Relation::checkRelationCache('lock');
        try {
            $c = new Criteria();
            $c->addAscendingOrderByColumn('id1');
            $c->addAscendingOrderByColumn('document_model2');
            $c->addAscendingOrderByColumn('sort_order');
            $relations = RelationPeer::doSelect($c);
            $relationsFile = sfConfig::get('sf_root_dir') . "/cache/objcache/childrenRelations.php";
            echo_cms("Processing children :");
            $i = 0;
            $content = "<?php \n";
            $oldIDModel = '';
            $currIDModel = '';
            $idStr = '';
            foreach ($relations as $relation) {
                $currIDModel = $relation->getId1() . ':' . $relation->getDocumentModel2();
开发者ID:kotow,项目名称:work,代码行数:67,代码来源:sfPakeMisc.php

示例8: executeSetPublicationStatus

 public function executeSetPublicationStatus()
 {
     $items = explode(",", $this->getRequestParameter('items'));
     $status = $this->getRequestParameter('status');
     if ($status == 'online') {
         $status = UtilsHelper::STATUS_ACTIVE;
     }
     if ($status == 'offline') {
         $status = UtilsHelper::STATUS_DEACTIVATED;
     }
     try {
         foreach ($items as $item) {
             $document = Document::getDocumentInstance($item);
             if (method_exists($document, 'setPublicationStatus')) {
                 $document->setPublicationStatus($status);
                 $document->save();
                 Document::cacheObj($document, null, true);
             }
         }
     } catch (Exception $e) {
         exit("A probleme occured: " . $e->getMessage());
     }
     exit("OK");
 }
开发者ID:kotow,项目名称:work,代码行数:24,代码来源:actions.class.php

示例9: save

 public function save($con = null, $parent = null, $refreshTree = true)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         $genericDoc = Document::getGenericDocument($this);
         if (!$this->getId()) {
             $this->setId($genericDoc->getId());
         }
         parent::save($con);
         // create relationship
         if (!$parent) {
             $parent = Document::getParentOf($this->getId(), null, true, false);
             if (empty($parent)) {
                 $parent = Rootfolder::getRootfolder($this);
             }
         }
         Relation::saveRelation($parent, $this);
         $con->commit();
         Document::cacheObj($this, "Media", $refreshTree);
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
开发者ID:kotow,项目名称:work,代码行数:26,代码来源:Media.php


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