當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Revision::setRevisionStateId方法代碼示例

本文整理匯總了PHP中Revision::setRevisionStateId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Revision::setRevisionStateId方法的具體用法?PHP Revision::setRevisionStateId怎麽用?PHP Revision::setRevisionStateId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Revision的用法示例。


在下文中一共展示了Revision::setRevisionStateId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 public function save(Doctrine_Connection $conn = null)
 {
     $is_new = $this->isNew();
     $procedure = parent::Save($conn);
     if ($is_new) {
         /*
         $dc=DatoCatastralPeer::retrieveByPK($this->getDatoCatastralId());
         $numero=$dc->getNumero().'-'.$dc->getCircunscripcion().'-'.$dc->getSeccion().'-'.$this->getId();
         $this->setNumero($numero);
         $this->save();
         */
         // singleton
         $singleton = sfContext::getInstance();
         $revision = new Revision();
         $revision->setNumber(0);
         $revision->setProcedureId($this->get('id'));
         $revision->setRevisionStateId(1);
         // <- Estado inicial.
         $revision->setBlock(true);
         // <- Bloqueamos la revision.
         $revision->setCreatorId($singleton->getUser()->getGuardUser()->getId());
         $revision->save();
         // Agregamos registro usuario_tramite
         $usuarioTramite = new UserProcedure();
         $usuarioTramite->setUserId($singleton->getUser()->getGuardUser()->getId());
         $usuarioTramite->setProcedureId($this->get('id'));
         $usuarioTramite->save();
     } else {
         /*
             //guarda el numero de tramite en funcion del dato catastral
             $dc=DatoCatastralPeer::retrieveByPK($this->getDatoCatastralId());
             $numero=$dc->getNumero().'-'.$dc->getCircunscripcion().'-'.$dc->getSeccion().'-'.$this->getId();
             $this->setNumero($numero);
             //$this->save();
             return parent::save($con);
         */
     }
 }
開發者ID:retrofox,項目名稱:Huemul,代碼行數:38,代碼來源:Procedure.class.php

示例2: executeComplete

 /**
  * action Complete
  *
  * @author Damian Suarez
  */
 public function executeComplete(sfWebRequest $request)
 {
     $user = $this->getUser()->getGuardUser();
     if ($user->hasPermission('Responsable de cierre')) {
         $this->revision = Doctrine::getTable('Revision')->find($request->getParameter('id'));
         $this->procedure = $this->revision->getProcedure();
         // bloqueamos todas las revisiones
         foreach ($this->procedure->getRevisions() as $revision) {
             $revision->setBlock(true);
             $revision->save();
         }
         // Creamos la ultima revision
         $last_revision = new Revision();
         $last_revision->setRevisionStateId(4);
         $last_revision->setProcedureId($this->procedure->get('id'));
         $last_revision->setCreatorId($this->getUser()->getGuardUser()->get('id'));
         $last_revision->setBlock(true);
         $last_revision->setParentId($this->revision->get('id'));
         $last_revision->save();
         $this->redirect('procedures/index?id=' . $this->procedure->get('id'));
     }
 }
開發者ID:retrofox,項目名稱:Huemul,代碼行數:27,代碼來源:actions.class.php


注:本文中的Revision::setRevisionStateId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。