コード例 #1
0
 /**
  * Remove channel
  *
  * @param Request $request
  * @param Channel $channel
  *
  * @AclAncestor("pim_enrich_channel_remove")
  *
  * @return Response
  */
 public function removeAction(Request $request, Channel $channel)
 {
     // TODO This validation should be moved to a validator and that validation trigered by the remover
     $channelCount = $this->channelRepository->countAll();
     if ($channelCount <= 1) {
         throw new DeleteException($this->getTranslator()->trans('flash.channel.not removable'));
     }
     $this->channelRemover->remove($channel);
     if ($request->isXmlHttpRequest()) {
         return new Response('', 204);
     } else {
         return $this->redirect($this->generateUrl('pim_enrich_channel_index'));
     }
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function collect()
 {
     return ['nb_channels' => $this->channelRepository->countAll(), 'nb_locales' => $this->localeRepository->countAllActivated(), 'nb_products' => $this->productRepository->countAll(), 'nb_attributes' => $this->attributeRepository->countAll(), 'nb_families' => $this->familyRepository->countAll(), 'nb_users' => $this->userRepository->countAll()];
 }