show

@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since  0.8.0

@Template

@ParamConverter("vendor", class="Phospr\CoreBundle\Entity\Vendor")

@param  Request $request
@param  Vendor  $vendor
544708
public function showAction(Request $request, Vendor $vendor)
    {
        $this->get('white_october_breadcrumbs')
            ->addItem('Home', $this->get('router')->generate('_homepage'))
            ->addItem('Vendors', $this->get('router')->generate('phospr_vendor'))
            ->addItem(
                $vendor->getName(),
                $this->get('router')->generate('phospr_vendor_show', array(
                    'slug' => $vendor->getSlug(),
                ))
            )
        ;

        return array('vendor' => $vendor);
    }
740371
public function showAction(Request $request)
    {
        $gridSource = $this->get('dtc_grid.manager.source')->get($request->get('id'));
        $id = $request->get('identifier');
        $result = $gridSource->find($id);

        $responseResult = [];
        if (!$result) {
            return new Response('Not Found', 404);
        }
        if (is_array($result)) {
            foreach ($result as $key => $value) {
                $responseResult[$this->fromCamelCase($key)] = $value;
            }
        } elseif (method_exists($gridSource, 'getClassMetadata')) {
            $classMetadata = $gridSource->getClassMetadata();
            $fieldNames = $classMetadata->getFieldNames();
            foreach ($fieldNames as $fieldName) {
                $method = 'get'.ucfirst($fieldName);
                if (method_exists($result, $method)) {
                    $responseResult[$this->fromCamelCase($fieldName)] = $result->$method();
                }
            }
        }

        return new JsonResponse($responseResult);
    }
255038
public function show($request) {
        $this->resolveModel();
        $model = Dir::apiModel($this->model);

        if(empty($request->relationalModel))
            return $model::find($request->id);
        else {
            $modelRelational = trim(strtolower($request->relationalModel), 's');
            return $model::where([
                $model::EQUALS(
                    $modelRelational.'Id',
                    $request->idRelational
                ),
                $model::EQUALS(
                    'id',
                    $request->id
                )
            ]);
        }
    }
980182
private function appendVendorInformationNode(VendorInfo $vendorInfo, \DOMNode $parentNode)
    {
        $vendorNode = $parentNode->appendChild($this->document->createElement('vendor'));
        $vendorNode->setAttribute('type', $vendorInfo->getType());

        foreach ($vendorInfo->getParameters() as $key => $value) {
            $parameterNode = $this->document->createElement('parameter');
            $parameterNode->setAttribute('name', $key);
            $parameterNode->setAttribute('value', $value);
            $vendorNode->appendChild($parameterNode);
        }
    }
995969
public function show(Request $request, $id)
    {
        $menuItem = Menu::where('id', $id)->first();

        return $this->response()->item($menuItem, new NodeTransformer());
    }
749777
public function show(Request $request,  Evento $evento)
	{
		Debugbar::info($evento);
		return view('multimedia::eventos/show', [
				'evento' => $evento,
		]);
	}
648127
public function apply(Request $request, ParamConverter $configuration)
    {
        $name = $configuration->getName();
        $repo = null;

        if (null != $request->attributes->get('id')) {
            $repo = $this->findById($request);
        } else {
            if (null != $request->attributes->get('slug')) {
                $repo = $this->findBySlug($request);
            }
        }

        if ($repo) {
            $request->attributes->set($name, $repo);

            return true;
        }

        return false;
    }
252189
public function showAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        /* @var $rep NoticeRepository */
        $rep = $em->getRepository('AnimeDbAppBundle:Notice');

        $notice = $rep->getFirstShow();
        // caching
        /* @var $response JsonResponse */
        $response = $this->getCacheTimeKeeper()->getResponse([], -1, new JsonResponse());
        $response->setEtag(md5($notice ? $notice->getId() : 0));
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        // shown notice
        if (!is_null($notice)) {
            $notice->shown();
            $em->persist($notice);
            $em->flush();

            $response->setData([
                'notice' => $notice->getId(),
                'close' => $this->generateUrl('notice_close', ['id' => $notice->getId()]),
                'see_later' => $this->generateUrl('notice_see_later'),
                'content' => $this->renderView('AnimeDbAppBundle:Notice:show.html.twig', [
                    'notice' => $notice,
                    'link_all' => $request->query->getBoolean('all'),
                ]),
            ]);
        }

        return $response;
    }
1152635
public function indexAction(Request $request)
    {
        exit('deprecated');
        $this->get('white_october_breadcrumbs')
            ->addItem('Home', $this->get('router')->generate('_homepage'))
            ->addItem('Vendors', $this->get('router')->generate('phospr_vendor'))
        ;

        $organization = $this->get('phospr.organization_handler')
            ->getOrganization()
        ;

        $vendor = new Vendor();
        $vendor->setOrganization($organization);

        $form = $this->createForm(new VendorType(), $vendor, array(
            'label' => 'Create',
            'action' => $this->generateUrl('phospr_vendor_new'),
        ));

        $vendors = $organization->getVendors();

        if ('json' == $request->getRequestFormat()) {
            $vendorsArray = array();

            foreach ($vendors as $vendor) {
                $vendorsArray[] = array(
                  'label'                     => $vendor->getName(),
                  'value'                     => $vendor->getName(),
                  'defaultOffsetAccount'      => $vendor
                      ->getDefaultOffsetAccountSegmentation(),
                  'defaultJournalDescription' => $vendor
                      ->getDefaultJournalDescription(),
                  'defaultJournalCreditAmount' => $vendor
                      ->getDefaultJournalCreditAmount(),
                  'defaultJournalDebitAmount' => $vendor
                      ->getDefaultJournalDebitAmount(),
                );
            }

            $response = new Response(json_encode($vendorsArray, JSON_PRETTY_PRINT));
            $response->headers->set('Content-Type', 'application/json');

            return $response;
        }

        return array(
            'vendors' => $vendors,
            'form'     => $form->createView(),
        );
    }
10144
public function apply(Request $request, ParamConverter $configuration)
    {
        $fieldName = $this->getOptions($configuration)['type_field'];

        if ($fieldName) {
            $value = $request->attributes->get($fieldName);
            if (!$value) {
                throw new NotFoundHttpException(sprintf('Expected to have `%s` attribute present', $fieldName));
            }

            $className = $this->contentType->getContentTypeClass($value);

            if (null === $className) {
                throw new NotFoundHttpException(sprintf('Cannot guess page type from request: %s', $value));
            }

            $configuration->setClass($className);
        }

        return parent::apply($request, $configuration);
    }
689995
public function apply(Request $request, ParamConverter $configuration)
    {
        if (null === $parameter = $configuration->getName()) {
            throw new InvalidConfigurationException(InvalidConfigurationException::MISSING_NAME);
        }

        if (null === $entityClass = $configuration->getClass()) {
            throw new InvalidConfigurationException(InvalidConfigurationException::MISSING_CLASS);
        }

        $options = $configuration->getOptions();

        if (!isset($options['id'])) {
            throw new InvalidConfigurationException(InvalidConfigurationException::MISSING_ID);
        }

        if ($request->attributes->has($options['id'])) {
            if (null !== $id = $request->attributes->get($options['id'])) {
                if (null !== $entity = $this->em->getRepository($entityClass)->find($id)) {
                    $request->attributes->set($parameter, $entity);

                    return true;
                }
            }

            if (!$configuration->isOptional()) {
                throw new NotFoundHttpException();
            }
        }

        return false;
    }
97474
public function apply(Request $request, ParamConverter $configuration)
    {
        $slug = $request->get('slug', null);
        $username = $request->get('username', null);
        $id = $request->get('id', null);

        if ($slug)
        {
            $searchArray = array('slug' => $slug);
        }
        elseif($username)
        {
            $searchArray = array('username' => $username);
        }
        elseif($id)
        {
            $searchArray = array('id' => $id);
        }
        else
        {
            throw new \InvalidArgumentException('Route attribute is missing');
        }

        $class = $this->targetEntitiesArray[$configuration->getClass()];

        $repository = $this->doctrine->getRepository($class);

        $object = $repository->findOneBy( $searchArray );

        if(!$object)
            throw new NotFoundHttpException("Sorry, requested resource can't be found.");

        $request->attributes->set($configuration->getName(), $object);

    }
1078235
public function show(Request $request)
    {
        $pdf = PDF::loadView('laralum_pdf::pdf', ['text' => $request->text]);

        return Response::make($pdf->download('output.pdf'), 200, ['content-type' => 'application/pdf']);
    }
393964
public function show(Request $request)
    {
        $thread = $this->api('thread.fetch', $request->route('thread'))
                       ->parameters(['include_deleted' => auth()->check()])
                       ->get();

        event(new UserViewingThread($thread));

        $category = $thread->category;

        $categories = [];
        if (Gate::allows('moveThreadsFrom', $category)) {
            $categories = $this->api('category.index')->parameters(['where' => ['category_id' => 0]], ['where' => ['enable_threads' => 1]])->get();
        }

        $posts = $thread->postsPaginated;

        return view('forum::thread.show', compact('categories', 'category', 'thread', 'posts'));
    }
1126790
public function show(Request $request, $key)
    {
        $model = $this->findFirstByKey($key);

        if (!$model) {
            if ($request->wantsJson()) {
                return $this->validNotFoundJsonResponse();
            }
            abort(404);
        }

        if ($request->wantsJson()) {
            return response()->json($model, 200, [], JSON_PRETTY_PRINT);
        }

        $view = $this->getViewLocation(__FUNCTION__);
        $this->checkViewExists($view);

        return response()->view($view, compact('model'));
    }
693214
public function show(PageRequest $request, Page $page)
    {

        if ($page->exists) {
            $view = 'page::admin.page.show';
        } else {
            $view = 'page::admin.page.new';
        }

        return $this->response->setMetaTitle(trans('app.view') . ' ' . trans('page::page.name'))
            ->data(compact('page'))
            ->view($view)
            ->output();
    }
743624
public function apply(Request $request, ParamConverter $configuration): bool
    {
        if (!$request->get(self::PARAMETER_VERSION_NO) || !$request->get(self::PARAMETER_CONTENT_ID)) {
            return false;
        }

        $versionNo = (int)$request->get(self::PARAMETER_VERSION_NO);
        $contentId = (int)$request->get(self::PARAMETER_CONTENT_ID);

        $contentInfo = $this->contentService->loadContentInfo($contentId);
        $versionInfo = $this->contentService->loadVersionInfo($contentInfo, $versionNo);

        $request->attributes->set($configuration->getName(), $versionInfo);

        return true;
    }