本文整理汇总了PHP中Revision::setCreatorId方法的典型用法代码示例。如果您正苦于以下问题:PHP Revision::setCreatorId方法的具体用法?PHP Revision::setCreatorId怎么用?PHP Revision::setCreatorId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Revision
的用法示例。
在下文中一共展示了Revision::setCreatorId方法的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);
*/
}
}
示例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'));
}
}