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


PHP Folder::getInstance方法代码示例

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


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

示例1: executeDecisionSave

 /**
  * @param sfWebRequest $request
  */
 public function executeDecisionSave(sfWebRequest $request)
 {
     $decision_id = $this->getUser()->getAttribute('decision_id', null, 'sfGuardSecurityUser');
     if ($decision_id) {
         $decision = DecisionTable::getInstance()->getDecisionForUser($this->getUser()->getGuardUser(), $decision_id);
         $this->forward404Unless(is_object($decision));
     } else {
         $decision = new Decision();
         $decision->type_id = 2;
         // Product development
         $type_template = TypeTemplate::getInstance()->createQuery('t')->where('t.user_id is NULL')->andWhere('t.type_id = ?', 2)->andWhere('t.name = ?', 'Default')->execute();
         $decision->template_id = $type_template[0]->getId();
         // Default template
         $folder = Folder::getInstance()->createQuery('t')->where('t.user_id = ?', $this->getUser()->getGuardUser()->id)->andWhere('t.deletable = ?', 0)->execute();
         if (!empty($folder)) {
             $decision->setFolderId($folder[0]->getId());
         }
     }
     $decision->name = $request->getParameter('name');
     if ($decision->name == '') {
         $decision->name = 'New project';
     }
     $decision->save();
     $this->getUser()->setAttribute('decision_id', $decision->id, 'sfGuardSecurityUser');
     $this->redirect('@wizard\\alternatives?decision_id=' . $decision->id);
 }
开发者ID:sensorsix,项目名称:app,代码行数:29,代码来源:actions.class.php

示例2: preSave

 public function preSave($event)
 {
     if (!$this->folder_id) {
         $this->folder_id = Folder::getInstance()->getNotDeletableForUser(sfContext::getInstance()->getUser()->getGuardUser(), Folder::TYPE_ROADMAP)->getId();
     }
     $log = new Log();
     $log->injectDataAndPersist($this, sfContext::getInstance()->getUser()->getGuardUser(), array('action' => $this->isNew() ? 'new' : 'edit'));
 }
开发者ID:sensorsix,项目名称:app,代码行数:8,代码来源:Roadmap.class.php

示例3: preSave

 public function preSave($event)
 {
     if (array_key_exists('template_id', $this->getModified()) && !$this->isNew()) {
         $this->template_changed = true;
     }
     if (empty($this->start_date)) {
         $this->start_date = null;
     }
     if (empty($this->end_date)) {
         $this->end_date = null;
     }
     if (!$this->folder_id) {
         $this->folder_id = Folder::getInstance()->getNotDeletableForUser(sfContext::getInstance()->getUser()->getGuardUser(), Folder::TYPE_PROJECT)->getId();
     }
 }
开发者ID:sensorsix,项目名称:app,代码行数:15,代码来源:Decision.class.php

示例4: executeNewFolder

 public function executeNewFolder(sfWebRequest $request)
 {
     $this->forward404Unless($request->isXmlHttpRequest());
     $folder = new Folder();
     $folder->setName('New ' . InterfaceLabelTable::getInstance()->get($this->getuser()->getGuardUser(), InterfaceLabelTable::FOLDER_TYPE));
     $folder->setUser($this->getUser()->getGuardUser());
     $folder->setType(Folder::TYPE_ROADMAP);
     if (!Folder::getInstance()->getNotDeletableForUser($this->getUser()->getGuardUser(), Folder::TYPE_ROADMAP, false)) {
         $folder->setDeletable(false);
     }
     $folder->save();
     // Create log
     $log = new Log();
     $log->injectDataAndPersist($folder, $this->getUser()->getGuardUser(), array('action' => 'new'));
     return $this->renderText(json_encode($folder->getRowData()));
 }
开发者ID:sensorsix,项目名称:app,代码行数:16,代码来源:actions.class.php


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