Display one collection.


@param $collectionId
@param $slug

@throws NotFoundHttpException

@return Response
193000
public function viewAction($collectionId, $slug)
    {
        $collection = $this->get('sonata.classification.manager.collection')->findOneBy(['id' => $collectionId]);

        if (!$collection) {
            throw new NotFoundHttpException(sprintf('Unable to find the collection with id=%d', $collectionId));
        }

        return $this->render('SonataProductBundle:Collection:view.html.twig', [
           'collection' => $collection,
        ]);
    }
14921
public function indexAction($id, $slug)
    {
        $player = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:Player')->getPlayerWithGames($id);
        if ($slug !== $player->getSlug()) {
            return $this->redirectToRoute('vgr_player_index', ['id' => $player->getIdPlayer(), 'slug' => $player->getSlug()], 301);
        }

        $nbPlayer = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:Player')->getNbPlayer(['nbChart>0' => true]);

        $rows = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:PlayerChart')->getRows(
            [
                'idPlayer' => $id,
                'limit' => 1,
                'orderBy' => [
                    'column' => 'pc.dateModif',
                    'order' => 'DESC',
                ],
            ]
        );
        if (count($rows) == 1) {
            $lastChart = $rows[0];
        } else {
            $lastChart = null;
        }

        //----- breadcrumbs
        $breadcrumbs = $this->get('white_october_breadcrumbs');
        $breadcrumbs->addRouteItem('Home', 'homepage');
        $breadcrumbs->addItem($player->getPseudo());

        return $this->render(
            'VideoGamesRecordsCoreBundle:Player:index.html.twig',
            [
                'player' => $player,
                'nbPlayer' => $nbPlayer,
                'lastChart' => $lastChart
            ]
        );
    }
982303
public function showAction($slug)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AmulenNewsBundle:Post')->findOneBy(array("slug" => $slug));

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

        $seoPage = $this->container->get('sonata.seo.page');

        $pageTitle = $entity->getTitle() . " - " . $seoPage->getTitle();
        $pageDescription = $entity->getAbstract();

        $baseUrl = $this->container->getParameter('router.request_context.scheme') . "://";
        $baseUrl .= $this->container->getParameter('router.request_context.host');
        $baseUrl .= $this->container->getParameter('router.request_context.base_url');

        $seoPage
            ->setTitle($pageTitle)
            ->addMeta('name', 'description', $pageDescription)
            ->addMeta('property', 'og:title', $entity->getTitle())
            ->addMeta('property', 'og:description', $pageDescription)
            ->addMeta('property', 'og:image', $baseUrl . $entity->getImage())
        ;

        return array(
            'entity' => $entity,
        );
    }
207720
public function showAction($id = null)
    {
        /** @var Request $request */
        $request = $this->get('request_stack')->getCurrentRequest();

        $id = $request->get($this->admin->getIdParameter());

        /** @var PageInterface $object */
        $object = $this->admin->getObject($id);

        if (!$object) {
            throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
        }

        if (false === $this->admin->isGranted('VIEW', $object)) {
            throw new AccessDeniedException();
        }

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

        return $this->renderWithExtraParams(
            $this->admin->getTemplate('show'),
            [
                'action' => 'show',
                'object' => $object,
                'elements' => $this->admin->getShow(),
            ]
        );
    }
627767
protected function setCollectionCollection($collection_id)
    {
        $this->data_collection = $this->collection->get($collection_id);

        if (empty($this->data_collection)) {
            $this->outputHttpStatus(404);
        }
    }
167199
public function show($slug)
    {
        $model = $this->repository->bySlug($slug, ['translations', 'files', 'files.translations']);

        return view('galleries::public.show')
            ->with(compact('model'));
    }
1020264
public function show($slug)
	{
		$post = $this->posts->findBySlug($slug);

		if ( ! $post)
		{
			return App::abort(404, 'Page not found');
		}

		return View::make($this->theme.'.post', compact('post'));
	}
439599
public function getIndexes($collectionId)
    {
        $urlParams = [self::OPTION_COLLECTION => $collectionId];
        $url       = UrlHelper::appendParamsUrl(Urls::URL_INDEX, $urlParams);
        $response  = $this->getConnection()->get($url);

        return $response->getJson();
    }
1142772
public function queryCollection($collectionGuid, $options = [])
    {
        $options['guid'] = $collectionGuid;
        return $this->_request(self::QUERY_COLLECTION, $options);
    }
114976
public function viewAction($collectionId)
    {
        $this->denyAccessUnlessGranted('ez:infocollector:read');

        $collection = $this->service->getCollection(new Query(['collectionId' => $collectionId]));

        return $this->render("NetgenInformationCollectionBundle:admin:view.html.twig", [
            'collection' => $collection,
            'content' => $collection->content,
        ]);
    }
1051211
public function updateCollectorResponse($collectorId, $responseId, array $data = [])
	{
		return $this->sendRequest(
			$this->createRequest('PATCH', sprintf('collectors/%s/responses/%s', $collectorId, $responseId), [], $data)
		);
	}
446426
public function getWithContent( $id, $slug = null ) {

		$modelClass	= static::$modelClass;
		$modelTable	= $this->getModelTable();

		if( isset( $slug ) ) {

			return $modelClass::queryWithContent( [ 'conditions' => [ "$modelTable.slug" => $slug ] ] )->one();
		}

		return $modelClass::queryWithContent( [ 'conditions' => [ "$modelTable.id" => $id ] ] )->one();
	}
1056363
public function findModel($id, $slug = '')
    {
        if($this->_model === null) 
        {
            if(($this->_model = $id ? Post::findOne($id) : Post::findOne(['slug' => $slug])) !== null) 
            {
                return $this->_model;
            } else {
                throw new NotFoundHttpException(Module::t('core', 'The requested model does not exist.'));
            }
        }
    }
933584
public function show($slug)
    {
        $page = Page::published()
            ->where('slug', $slug)
            ->first();

        if ($page === null) {
            app()->abort(404, 'page with slug \''.$slug.'\' not found');
        }

        $this->authorize('show', $page);

        return view('site::page')->with('page', $page);
    }
961888
public function listProductsAction($collectionId)
    {
        $pager = $this->get('sonata.product.set.manager')
            ->getProductsByCollectionIdPager($collectionId, $this->getCurrentRequest()->get('page'));

        return $this->render('SonataProductBundle:Collection:list_products.html.twig', [
            'pager' => $pager,
        ]);
    }
1108458
public function paginate($collection, $id = null)
    {
        $adapter = $this->adapterFactory->createAdapter($collection);

        $this->totalItems[md5($id)] = $adapter->getTotalResults();
        $offset = $this->calculateOffset($id);

        return $adapter->setOffset($offset)->setLength($this->getItemsPerPage($id));
    }
1309890
public function actionDelete($slug, $id)
    {
        $current_model = $this->module->getModel($slug);

        if(($current_model = $current_model::findOne($id))){
            $current_model->delete();
        } else {
            $this->error =  Yii::t('easyii', 'Not found');
        }
        return $this->formatResponse(Yii::t('gr', 'Post deleted'));
    }