Exemplo n.º 1
0
 /**
  * Erstellt einen Lock-Eintrag
  *
  * @param string  $userId
  * @param string  $runId
  * @param string  $itemId
  * @param string  $websiteId
  * @param string  $type
  * @return boolean
  */
 public function lockItem($userId, $runId, $itemId, $websiteId, $type)
 {
     try {
         $lock = new Lock();
         $lock->setUserid($userId);
         $lock->setRunid($runId);
         $lock->setItemid($itemId);
         $lock->setWebsiteid($websiteId);
         $lock->setType($type);
         $lock->setStarttime(time());
         $lock->setLastactivity($lock->getStarttime());
         $this->getEntityManager()->persist($lock);
         $this->getEntityManager()->flush();
         $this->getEntityManager()->refresh($lock);
     } catch (\Exception $e) {
         throw new CmsException(1503, __METHOD__, __LINE__, null, $e);
     }
     return $lock;
 }
Exemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function toCmsData()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'toCmsData', array());
     return parent::toCmsData();
 }