View method

@param string|null $id Profile id.
@return \Cake\Network\Response|null
@throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
199807
public function view($id = null)
    {
        $profile = $this->Profiles->get($id, [
            'contain' => ['Users']
        ]);

        $this->set('profile', $profile);
        $this->set('_serialize', ['profile']);
    }
968649
public function showAction($id)
    {
        $hub     = $this->getRepo('Profile')->find($id);
        $origin  = $hub->getDefaultLocation();
        $buyer   = $this->getUser()->getCurrentProfile();

        if (!$hub)
        {
            throw $this->createNotFoundException('No hub found for id '.$id);
        }

        $buyerHubRef = $this->getRepo('BuyerHubRef')->findOneByBuyerAndHub($buyer, $hub);

        return $this->render('HarvestCloudCoreBundle:Buyer/Hub:show.html.twig', array(
          'hub'         => $hub,
          'buyerHubRef' => $buyerHubRef,
          'origin'      => $origin,
        ));
    }
461409
public function historyAction($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->admin->checkAccess('history', $object);

        $manager = $this->get('sonata.admin.audit.manager');

        if (!$manager->hasReader($this->admin->getClass())) {
            throw $this->createNotFoundException(
                sprintf(
                    'unable to find the audit reader for class : %s',
                    $this->admin->getClass()
                )
            );
        }

        $reader = $manager->getReader($this->admin->getClass());

        $revisions = $reader->findRevisions($this->admin->getClass(), $id);

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

        return $this->renderWithExtraParams($template, [
            'action' => 'history',
            'object' => $object,
            'revisions' => $revisions,
            'currentRevision' => $revisions ? current($revisions) : false,
        ], null);
    }
968283
public function viewAction($id)
    {
        $post = $this->get('opifer.form.post_manager')->getRepository()->find($id);

        if (!$post) {
            return $this->createNotFoundException();
        }

        return $this->render($this->getParameter('opifer_form.post_view_view'), [
            'post' => $post,
        ]);
    }
286073
public function getVazby($id = null)
    {
        if (is_null($id)) {
            $id = $this->getRecordID();
        }
        if (!empty($id)) {
            $vazbyRaw = $this->getColumnsFromFlexibee(['vazby'],
                ['relations' => 'vazby', 'id' => $id]);
            $vazby    = array_key_exists('vazby', $vazbyRaw[0]) ? $vazbyRaw[0]['vazby']
                    : null;
        } else {
            throw new \Exception(_('ID requied to get record relations '));
        }
        return $vazby;
    }
418557
protected function findModel($id)
    {
        $user = User::findOne($id);
        if ($user === null) {
            throw new NotFoundHttpException('The requested page does not exist');
        }
        return $user;
    }
284287
public function renderZoneView($id)
    {
        if (($model = (new Zone())->find()->joinWith('records')->where(['id' => $id])->one()) === null) {
            throw new NotFoundHttpException('DNS zone does not exist');
        }
        $recordsDataProvider = new ArrayDataProvider(['allModels' => $model->records, 'pagination' => false]);

        return $this->render('/zone/view', [
            'model' => $model,
            'recordsDataProvider' => $recordsDataProvider,
        ]);
    }
438475
public function show($id)
    {
        $record = $this->modelRepository->findOrFail($id);

        $this->checkListParents(false);

        return view($this->getShowView(), [
            'moduleKey'           => $this->moduleKey,
            'routePrefix'         => $this->routePrefix,
            'permissionPrefix'    => $this->permissionPrefix,
            'model'               => $this->modelInformation,
            'record'              => $record,
            'recordReference'     => $this->getReferenceRepository()->getReferenceForModel($record),
            'fieldStrategies'     => $this->renderedShowFieldStrategies($record),
            'hasActiveListParent' => (bool) $this->listParentRelation,
            'topListParentOnly'   => $this->showsTopParentsOnly(),
            'listParents'         => $this->listParents,
        ]);
    }
634982
public function view($id = null)
    {
        $cmsPermission = $this->CmsPermission->get($id, [
            'contain' => ['CmsTerm', 'CmsContent']
        ]);
        $this->set('cmsPermission', $cmsPermission);
        $this->set('_serialize', ['cmsPermission']);
    }
189446
protected function findModel($id)
    {
        $user = $this->finder->findUserById($id);
        if ($user === null) {
            throw new NotFoundHttpException('The requested page does not exist');
        }

        return $user;
    }
937614
public function viewAction($id)
    {
        $content = $this->contentManager->getContentById($id);

        if ($content === null) {
            throw EntityNotFoundException::fromClassNameAndIdentifier(
                $this->configurationManager->getEntityClass('content'),
                [$id]
            );
        }

        return $this->render('@SherlockodeAdvancedContent/Content/view.html.twig', [
            'content' => $content,
        ]);
    }
181943
public function show($id = null)
    {
        if ($id === 'new') {
            return response()->json([
                'entry' => WinkPost::make(['id' => Str::uuid(), 'publish_date' => now()->format('Y-m-d H:i:00')]),
            ]);
        }

        $entry = WinkPost::with('tags')->findOrFail($id);

        return response()->json([
            'entry' => $entry,
        ]);
    }
586679
public function getResponse($id)
	{
		foreach ($this->_responses as $response)
			if ($response->id == $id)
				return $response;

		return null;
	}
1108081
public function actionShow($id) {
    $profile = Profile::find()->byId($id)->one();

    if ($profile === null) {
      throw new NotFoundHttpException();
    }

    return $this->render('show', [
      'profile' => $profile,
    ]);
  }
846965
public function view($id = null) {
		if (empty($id) || !($continent = $this->Continents->find('first', ['conditions' => ['Continent.id' => $id]]))) {
			$this->Flash->error(__('invalid record'));
			return $this->Common->autoRedirect(['action' => 'index']);
		}
		$this->set(compact('continent'));
	}
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(),
            ]
        );
    }
1231962
public function actionIndexPost($id=NULL)
	{
		if ($id === NULL)
			return $this->createNewPost();
		else
			return $this->updatePost($id);
	}