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