Finds and displays a Brand entity.

@Route("/{id}")
@Method("GET")
@Template()
177942
public function showAction(Brand $brand)
    {
        $deleteForm = $this->createDeleteForm($brand);

        return array(
            'entity' => $brand,
            'delete_form' => $deleteForm->createView(),
        );
    }
949401
private function checkId($context, $id)
    {
        $ret = false;
        if (is_numeric($id)){
            if ("catalog" === $context){
                $cat = CategoryQuery::create()->findPk($id);
                $ret = (null !== $cat && $cat->getVisible());
            } elseif ("brand" === $context) {
                $brand = BrandQuery::create()->findPk($id);
                $ret = (null !== $brand && $brand->getVisible());
            } else {
                $folder = FolderQuery::create()->findPk($id);
                $ret = (null !== $folder && $folder->getVisible());
            }
        }
        return $ret;
    }
651326
public function show($id)
    {
        $modelName = $this->modelFullName;
        $model = $modelName::find($id);
        if(!$model) throw new NotFoundException('There is no Resource with id = ' . $id . ' !');
        return $model;
    }
685349
public function findById($id)
    {
        $post = get_post($id);
        if (!is_null($post)) {
            return self::getEntity($post);
        }
    }
990879
public function getAction(Request $request, $id)
    {
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));
        $view = $this->responseGetById(
            $id,
            function ($id) use ($locale) {
                /** @var Product $product */
                $product = $this->getManager()->findByIdAndLocale($id, $locale);

                return $product;
            }
        );

        return $this->handleView($view);
    }
257419
protected function checkBrandIDField()
    {
        //Check "brand_id" field
        if ($this->obElement->getOriginal('brand_id') == $this->obElement->brand_id) {
            return;
        }

        //Update product ID cache list for brand
        ProductListStore::instance()->brand->clear($this->obElement->brand_id);
        ProductListStore::instance()->brand->clear((int) $this->obElement->getOriginal('brand_id'));
    }
1055331
protected function findUser($id)
    {
        if (($model = User::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
658298
protected function getExistingObject()
    {
        $brand = BrandQuery::create()
            ->findOneById($this->getRequest()->get('brand_id', 0));

        if (null !== $brand) {
            $brand->setLocale($this->getCurrentEditionLocale());
        }

        return $brand;
    }
183874
public function findModel($id)
    {
        $model = call_user_func_array([$this->MainModel, 'findOne'], [$id]);
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
1003972
public function findModel($id)
    {
        if($this->_model === null) 
        {
            if($this->_model = $id ? Author::findOne($id) : null) 
            {
                return $this->_model;
            } else {
                throw new NotFoundHttpException(Module::t('core', 'The requested model does not exist.'));
            }
        }
    }
1242501
public function showAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Invoice $entity */
        $invoice = $em->getRepository('EcommerceBundle:Invoice')->find($id);

        if (!$invoice) {
            throw $this->createNotFoundException('Unable to find Invoice entity.');
        }

        // download invoice
        if (!$invoice ||
            false === $this->container->get('checkout_manager')->isCurrentUserOwner($invoice->getTransaction())) {
            throw new AccessDeniedException();
        }

        /** @var CheckoutManager $checkoutManager */
        $checkoutManager = $this->container->get('checkout_manager');

        $delivery = $invoice->getTransaction()->getDelivery();
        $totals = $checkoutManager->calculateTotals($invoice->getTransaction(), $delivery);
        if ('true' === $request->get('download')) {
            $html = $this->container->get('templating')->render('EcommerceBundle:Profile:Invoice/download.html.twig', array(
                    'delivery' => $delivery,
                    'invoice'  => $invoice,
                    'totals'   => $totals,
                ));
            $html2pdf = $this->get('html2pdf_factory')->create();
            $html2pdf->WriteHTML($html);
            
            return new Response(
                $html2pdf->Output('invoice'.$invoice->getInvoiceNumber().'.pdf'),
                200,
                array(
                    'Content-Type'        => 'application/pdf',
                    'Content-Disposition' => 'attachment; filename="invoice'.$invoice->getInvoiceNumber().'.pdf"'
                )
            );
        }
        
       
        return array(
            'entity' => $invoice,
            'totals' => $totals,
        );
    }
156750
public function showBusinessPageByIdAction(Request $request, $entityId, $type)
    {
        $businessEntityHelper = $this->get('victoire_core.helper.queriable_business_entity_helper');
        $businessEntity = $businessEntityHelper->findById($type);
        $entity = $businessEntityHelper->getByBusinessEntityAndId($businessEntity, $entityId);

        $refClass = new \ReflectionClass($entity);

        $templateId = $this->get('victoire_business_page.business_page_helper')
            ->guessBestPatternIdForEntity($refClass, $entityId, $this->container->get('doctrine.orm.entity_manager'));

        $page = $this->get('victoire_page.page_helper')->findPageByParameters([
            'viewId'   => $templateId,
            'entityId' => $entityId,
            'locale'   => $request->getLocale(),
        ]);

        return $this->redirect(
            $this->generateUrl(
                'victoire_core_page_show',
                [
                    'url' => $page->getReference()->getUrl(),
                ]
            )
        );
    }
1093642
public function show($id)
    {
        $template = $this->client->get(sprintf('templates/%d.json', $id));

        return new Template($this->response($template));
    }
647988
public function show($id, Request $request)
    {
        $entity = $this->getEntityById($id);

        if (!$entity) {
            return $this->response(null, Response::HTTP_NOT_FOUND);
        }

        return $this->response($this->serialize($entity, $request), Response::HTTP_OK);
    }
893304
public function getProductAddonAction(Request $request, $id)
    {
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));
        $addon = $this->getManager()->findAddonById($id, $locale);

        $view = $this->view($addon, 200);

        return $this->handleView($view);
    }
331665
protected function findModel($id)
    {
        if (($model = Term::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
918706
public function showAction($attributeId, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Attribute $attribute */
        $attribute = $em->getRepository('EcommerceBundle:Attribute')->find($attributeId);

        if (!$attribute) {
            throw $this->createNotFoundException('Unable to find Attribute entity.');
        }

        /** @var AttributeValue $entity */
        $entity = $em->getRepository('EcommerceBundle:AttributeValue')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find AttributeValue entity.');
        }

        $deleteForm = $this->createDeleteForm($attributeId, $id);

        return array(
            'entity'      => $entity,
            'attribute'   => $attribute,
            'delete_form' => $deleteForm->createView(),
        );
    }