Return a single post.

@param  string  $id
@return \Illuminate\Http\JsonResponse
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,
        ]);
    }
879018
public function getResult($id)
    {
        return isset($this->results[$id]) ? $this->results[$id] : null;
    }
952750
public function getById($id)
    {
        $modelResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl(sprintf('models/%s', $id))
        );

        return $this->getModelFromResult($modelResult);
    }
1213219
public function getAction($id)
    {
        $view = $this->responseGetById(
            $id,
            function($id) {
                return $this->getDoctrine()
                    ->getRepository(self::$entityName)
                    ->find($id);
            }
        );

        return $this->handleView($view);
    }
1219724
public function findOrFail(int $id)
    {
        $response = $this->model->with($this->with)->findOrFail($id);
        $this->with = [];
        return $response;
    }
341341
public function getRequest($id)
    {
        if (!isset($this->request[$id])) {
            return null;
        }

        return $this->request[$id];
    }
679539
static function fetch( $id )
    {
        $cond = array( 'id' => $id );
        $return = eZPersistentObject::fetchObject( self::definition(), null, $cond );
        return $return;
    }
348917
public function get($id)
    {
        //ACCESS CHECK
        if (!$this->isAllowed(ResourceName::RESOURCE_SITES, 'admin')) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        // get default site data - kinda hacky, but keeps us to one controller
        if ($id == 'default') {
            $siteManager = $this->getSiteManager();

            $data = $siteManager->getDefaultSiteValues();

            $site = new Site(
                $this->getCurrentUserId(),
                'Get default site values in ' . get_class($this)
            );

            $site->populate($data);

            return new ApiJsonModel($site, 0, 'Success');
        }

        // get current site data - kinda hacky, but keeps us to one controller
        if ($id == 'current') {
            $site = $this->getCurrentSite();

            return new ApiJsonModel($site, 0, 'Success');
        }

        /** @var \Rcm\Repository\Site $siteRepo */
        $siteRepo = $this->getEntityManager()->getRepository(
            \Rcm\Entity\Site::class
        );

        try {
            $site = $siteRepo->find($id);
        } catch (\Exception $e) {
            return new ApiJsonModel(
                null,
                1,
                "Failed to find site by id ({$id})"
            );
        }
        /* ADDED THIS CHECK TO GET RID OF ERROR. */
        /* NOT SURE WHY TRY CATCH ABOVE ISN'T WORKING */

        if ($site instanceof Site) {
            return new ApiJsonModel($site, 0, 'Success');
        } else {
            return new ApiJsonModel(null, 1, "Failed to find site by id ({$id})");
        }
    }
326723
public function getObjectById($id)
    {
        if (isset($this->objects[$id])) {
            return $this->objects[$id];
        } else {
            return null;
        }
    }
866650
public function getPage($id)
    {
        $found_page = null;

        foreach ($this->pages as $page) {
            if ($page->id == $id) {
                $found_page = $page;
                break;
            }
        }

        return $found_page;
    }
136872
public function fetchById($id)
    {
        $data = $this->getRequest()->getContents($this->getKey(), $id);
        return $data;
    }
1261444
public function delete_post( $id ) {

		$post = get_post( $id );

		if ( empty( $post ) ) {
			return;
		}

		$id        = $post->ID;
		$post_type = $post->post_type;

		return $this->delete_object( 'post_type', $id, $post_type );
	}
953198
public function block($id)
    {
        $user = AppUser::find($id);

        if (!$user) {
            return response()->json(null, 404);
        }

        if ($user->isBlock()) {
            return response()->json(null, 204);
        }

        if (!$user->block()) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(null, 204);
    }
182503
public function getAction($id)
    {
        $findCallback = function($id) {
            $targetGroup = $this->getTargetGroupRepository()->find($id);

            return $targetGroup;
        };

        $view = $this->responseGetById($id, $findCallback);

        return $this->handleView($view);
    }
1269705
public function get($id)
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_200);
		
		$classifiedService = $this->getServiceLocator()->get('document.service.classified');
		
		try {
			$data = $classifiedService->get($id);
		} catch(\Exception $e) {
			$this->getResponse()
				->setStatusCode(Response::STATUS_CODE_500);
			$data = new \StdClass();
		}
		
		return new JsonModel(array(
			'data' => $data
		));
	}
1044348
public function fetch($id)
    {
        $rendition = CoreInterface::RENDITION_ORIGINAL;
        if ($this->getEvent()) {
            $rendition = $this->getEvent()->getQueryParam('rendition', CoreInterface::RENDITION_ORIGINAL);
        }

        $src = $this->imageManager->getSrc($id, $rendition);
        if ($src && !$this->isAccept('application/json')) {
            return $this->getRedirectResponse($src);
        }

        $hasImage = $this->imageManager->has($id, $rendition);
        if ($hasImage) {

            $image = $this->imageManager->get($id, $rendition);
            if ($this->isAccept($image->getMimeType()) || $this->isAccept('*/*', true)) {
                return $this->getHttpResponse($image);
            } else {

                return $this->getApigilityResponse($image, $id);
            }
        }

        return new ApiProblem(404, 'Image not found');
    }
936594
public static function get($id)
    {
        /** @var Entity $entity */
        $entity = new static();
        Manager::getInstance()->get($entity)->refreshRelations();
        $className = $entity->getClassName();
        $sql = Sql::createSql($entity->getAdapter())
            ->select($entity->getTableName())
            ->where(
                [
                    "{$entity->getTableName()}.{$entity->_primaryKey} = :id" =>
                        [
                            ':id' => $id
                        ]
                ]
            );
        $events = $entity->getEventManager();
        $event = new Select([
            'sqlQuery' => $sql,
            'params' => compact('id'),
            'action' => Select::GET,
            'singleItem' => true
        ]);
        $events->trigger(Select::BEFORE_SELECT, $entity, $event);
        $row = $event->sqlQuery->first();

        if ($row) {
            $event->data = $row;
            $events->trigger(Select::AFTER_SELECT, $entity, $event);
            $object = new $className($event->data);
            return $object;
        }
        return null;
    }