Finds and displays a Advert entity.

@Route("/{id}")
@Method("GET")
@Template()
172218
public function showAction(Advert $advert)
    {
        $deleteForm = $this->createDeleteForm($advert);

        return array(
            'entity' => $advert,
            'delete_form' => $deleteForm->createView(),
        );
    }
1256361
public function cgetAction(Request $request, $id)
    {
        try {
            if ($request->get('flat') == 'true') {
                $list = $this->getListRepresentation($request, $id);
            } else {
                $list = new CollectionRepresentation(
                    $this->getManager()->findAllByAttributeIdAndLocale($this->getLocale($request), $id),
                    self::$entityKey
                );
            }
            $view = $this->view($list, 200);
        } catch (AttributeNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 404);
        }

        return $this->handleView($view);
    }
398157
public function show($entityId = 0)
    {
        $entityId = StaticFilter::filter('text', $entityId);
        $entity = null;
        try {
            $entity = $this->getEntity($entityId);
            $this->set($this->getEntityNameSingular(), $entity);
        } catch (EntityNotFoundException $caught) {
            Log::logger()->addNotice($caught->getMessage());
            $this->addWarningMessage(
                $this->getMissingEntityMessage($entityId)
            );
            $this->redirectFromMissingEntity();
        }
        return $entity;
    }
84430
protected function findModel($id)
    {
        if (($model = Order::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
409803
public function getView($id)
    {

        $model = (!empty($id) || $id === "0") ? $this->findAutoDetectTranslation($id) : $this->model;
        $form  = FormBuilder::create(get_class($this->form), [
            'model' => $model
        ]);

        $form_content = view('form-builder::form.components.formgenerator.info', [
            'form'  => $form,
            'id'    => $id,
            'route' => $this->getControllerNameForAction().'@',
        ]);

        $this->layoutManager->add([
            'content' => view('expendable::admin.form.state.form', [
                'form' => $form_content
            ])
        ]);

        return $this->layoutManager->render();

    }
80187
public function show($id, Request $request)
    {
        /** @var Article $article */
        $article = Article::query()->findOrFail($id);
        $article->visited();

        $template = $request->get('tmpl', 'master');

        event(new ArticleWasViewed($article));

        return view($article->getTemplate(), compact('article', 'template'));
    }
461251
public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('EcommerceBundle:Advert')->find($id);
        $purchase = $em->getRepository('EcommerceBundle:ProductPurchase')->findOneByAdvert($entity);

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

        $form = $this->createEditForm($entity);
        
        return array(
            'entity'      => $entity,
            'purchase'   => $purchase,
            'form' => $form->createView(),
        );
    }
800301
public function findById(int $id)
    {
        $entity = null;

        for ($i = 0; $i < count($this->registries); $i++) {
            /** @var RegistryInterface $registry */
            $registry = $this->registries[ $i ];
            $entity = $registry->findByKey($id);

            if ($entity instanceof AbstractEntity) {
                $this->updateRegistries([$entity], $i - 1);
                break;
            }
        }

        return $entity;
    }
691114
private function createCreateForm(Advert $entity)
    {
        $form = $this->createForm(new AdvertFrontType(), $entity, array(
            'action' => $this->generateUrl('ecommerce_advertfront_create'),
            'method' => 'POST',
        ));

        return $form;
    }
887735
public function getQuestion($id)
    {
        /** @var TemplateInterface $template */
        foreach ($this->data as $template) {
            if ($template->getQuestion()->getId() == $id) {
                return $template;
            }
        }

        throw new NotFoundHttpException(sprintf('Id question %s not found', $id));
    }
721640
public function campaignEditForm($request)
    {
        // Get ID either from posted back value, or url parameter
        if (!$request) {
            $this->httpError(400);
            return null;
        }
        $id = $request->param('ID');
        if (!$id) {
            $this->httpError(400);
            return null;
        }
        return $this->getCampaignEditForm($id);
    }
546334
def view_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/views/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
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,
        );
    }
911794
public function preview($entity, $id)
    {
        $modelString = 'Grafite\Cms\Models\\'.ucfirst($entity);

        if (!class_exists($modelString)) {
            $modelString = 'Grafite\Cms\Models\\'.ucfirst($entity).'s';
        }

        $model = new $modelString();
        $modelInstance = $model->find($id);

        $data = [
            $entity => $modelInstance,
        ];

        if (config('app.locale') != config('cms.default-language', Cms::config('cms.default-language'))) {
            if ($modelInstance->translation(config('app.locale'))) {
                $data = [
                    $entity => $modelInstance->translation(config('app.locale'))->data,
                ];
            }
        }

        $view = 'cms-frontend::'.$entity.'.show';

        if (!View::exists($view)) {
            $view = 'cms-frontend::'.$entity.'s.show';
        }

        if ($entity === 'page') {
            $view = 'cms-frontend::pages.'.$modelInstance->template;
        }

        if ($entity === 'blog') {
            $view = 'cms-frontend::blog.'.$modelInstance->template;
        }

        return view($view, $data);
    }
773126
public function show($id)
    {
        $event = $this->repository->find($id);

        if (empty($event)) {
            abort(404);
        }

        return view('cms-frontend::events.'.$event->template)->with('event', $event);
    }
248955
public function showForm($id)
    {
        $form = $this->container->get('netvlies.form')->get($id);

        if ($form->getSuccess()) {
            return $this->container->get('templating')->render('NetvliesFormBundle:Twig:form_success.html.twig', array(
                'successMessage' => $form->getSuccessMessage(),
            ));
        } else {
            $formView = $form->getSf2Form()->createView();
            if ($this->container->getParameter('netvlies.form.templates.fields') != null) {
                $this->container->get('twig')->getExtension('form')->renderer->setTheme($formView, array($this->container->getParameter('netvlies.form.templates.fields')));
            }

            return $this->container->get('templating')->render($this->container->getParameter('netvlies.form.templates.form'), array(
                'id' => $form->getId(),
                'form' => $formView,
            ));
        }
    }
1263879
public function showAction($id = null)
    {
        $request = $this->getRequest();
        $id = $request->get($this->admin->getIdParameter());

        $object = $this->admin->getObject($id);

        if (!$object) {
            throw $this->createNotFoundException(sprintf('unable to find the object with id: %s', $id));
        }

        $this->checkParentChildAssociation($request, $object);

        $this->admin->checkAccess('show', $object);

        $preResponse = $this->preShow($request, $object);
        if (null !== $preResponse) {
            return $preResponse;
        }

        $this->admin->setSubject($object);

        $fields = $this->admin->getShow();
        \assert($fields instanceof FieldDescriptionCollection);

        // NEXT_MAJOR: replace deprecation with exception
        if (!\is_array($fields->getElements()) || 0 === $fields->count()) {
            @trigger_error(
                'Calling this method without implementing "configureShowFields"'
                .' is not supported since 3.40.0'
                .' and will no longer be possible in 4.0',
                E_USER_DEPRECATED
            );
        }

        // NEXT_MAJOR: Remove this line and use commented line below it instead
        $template = $this->admin->getTemplate('show');
        //$template = $this->templateRegistry->getTemplate('show');

        return $this->renderWithExtraParams($template, [
            'action' => 'show',
            'object' => $object,
            'elements' => $fields,
        ], null);
    }