Esempio n. 1
0
 /**
  * @return Lock
  */
 public function getLock()
 {
     $lock = $this->lockRepository->findLock();
     if (!$lock) {
         $lock = $this->createNew();
     }
     return $lock;
 }
Esempio n. 2
0
 /**
  * @param string $channel
  *
  * @return Lock
  */
 public function getLock($channel)
 {
     $lock = $this->lockRepository->findByChannel($channel);
     if (!$lock) {
         $lock = $this->createNew();
         $lock->setChannel($channel);
     }
     return $lock;
 }