コード例 #1
0
 /**
  * Schedule recalculation of completenesses for all products
  * of a channel
  *
  * @param Channel $channel
  */
 public function scheduleForChannel(Channel $channel)
 {
     if ($channel->getId()) {
         $deletedLocaleIds = $this->channelRepository->getDeletedLocaleIdsForChannel($channel);
         foreach ($deletedLocaleIds as $deletedLocaleId) {
             $deletedLocale = $this->localeRepository->find($deletedLocaleId);
             $this->generator->scheduleForChannelAndLocale($channel, $deletedLocale);
         }
     }
 }
コード例 #2
0
 /**
  * Get locale by code
  *
  * @param string $code
  *
  * @return Locale
  */
 public function getLocaleByCode($code)
 {
     return $this->repository->findOneBy(array('code' => $code));
 }