@ApiDoc()

@param int $id

@return ContentInterface[]
329280
public function getTemplateAction(Request $request, $id)
    {
        $version = $request->query->get('_version');

        /** @var TemplateBlockProvider $templateBlockProvider */
        $templateBlockProvider = $this->get('opifer.content.template_block_provider');
        $template = $templateBlockProvider->getBlockOwner($id);

        /** @var Environment $environment */
        $environment = $this->get('opifer.content.block_environment');
        $environment->setObject($template);

        if (null !== $version && $this->isGranted('ROLE_ADMIN')) {
            $environment->setDraft(true);
        }

        $environment->load();

        $blocks = $environment->getRootBlocks();

        $context = SerializationContext::create();
        $context->setGroups(['Default', 'tree', 'detail']);

        $contentItem = [
            'id' => $template->getId(),
            'name' => $template->getName(),
            'display_name' => $template->getDisplayName(),
            'blocks' => $blocks,
        ];

        $json = $this->get('jms_serializer')->serialize($contentItem, 'json', $context);

        return new JsonResponse(json_decode($json, true));
    }
1153681
public function getThreadSubscription(int $id): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/notifications/threads/:id/subscription', (string)$id));
    }
583399
public function update($id)
    {
        $return = [];
        $class = $this->model;

        $this->input['id'] = $id;
        $this->validate(request(), $this->getValidationRules());

        $model = $class::find($id);
        if ($this->canEdit($model)) {
            $this->fillModel($model);

            $return = $model->push()
                ? ['success' => ucfirst($this->readableResourceType()) . ' updated successfully.']
                : ['error' => 'There was a problem saving the ' . $this->readableResourceType() . '.'];
        } else {
            $return = [
                'error' => 'You don\'t have permission to edit this '
                    . $this->readableResourceType() . '.'
            ];
        }

        return $return;
    }
546611
public function findDocumentById($id)
    {
        $response = $this->request('GET', '/' . $id);
        if ($response->getStatusCode() !== 200) {
            return null;
        }

        return $this->documentFactory->createFromResponse($this, $id, $response);
    }
789507
public function show($id)
    {
        $apiRequest = RequestFactory::create();

        $resource = new GetResource(
            $this->serializer,
            $apiRequest->getFields(),
            $apiRequest->getIncludedRelationships()
        );

        $find = $this->findResourceCallable($id);

        return $this->addHeaders($resource->get($id, get_class($this->getDataModel()), $find));
    }
59526
public function getActions($id)
    {
        $actions = $this->adapter->get(sprintf('%s/volumes/%s/actions?per_page=%d', $this->endpoint, $id, 200));

        $actions = json_decode($actions);

        $this->meta = $this->extractMeta($actions);

        return array_map(function ($action) {
            return new ActionEntity($action);
        }, $actions->actions);
    }
1350560
public function MangaPictures(int $id): array
    {
        return $this->myanimelist->getMangaPictures(
            new Request\Manga\MangaPicturesRequest($id)
        );
    }
1326340
public function getBackups($id)
    {
        $backups = $this->adapter->get(sprintf('%s/droplets/%d/backups?per_page=%d', $this->endpoint, $id, 200));

        $backups = json_decode($backups);

        $this->meta = $this->extractMeta($backups);

        return array_map(function ($backup) {
            return new ImageEntity($backup);
        }, $backups->backups);
    }
1219724
public function findOrFail(int $id)
    {
        $response = $this->model->with($this->with)->findOrFail($id);
        $this->with = [];
        return $response;
    }
1344563
public function getWidgetContent(int $id): string
    {
        $widget = $this->repository->getItemByID($id);

        if ($widget->id) {
            $view = $widget->view;

            if (view()->exists($view)) {
                $params = $widget->params;
                return view($view, array_merge(is_array($params) ? $params : [], ['widget' => $widget]));
            }
        }

        return '';
    }
1007003
public function getDocumentById(string $id)
    {
        $arguments = $this->getRequestArguments();

        $assignments = [];
        if ($this->settings['paging']['detailPagePaging'] && array_key_exists('underlyingQuery', $arguments)) {
            // If underlying query has been sent, fetch more data to enable paging arrows.
            $underlyingQueryInfo = $arguments['underlyingQuery'];

            $index = FrontendUtility::getIndexes($underlyingQueryInfo);

            foreach ($arguments['underlyingQuery'] as $key => $value) {
                $arguments[$key] = $value;
            }

            $this->createQueryForArguments($arguments);
            $this->query->setStart($index['previousIndex']);
            $this->query->setRows($index['nextIndex'] - $index['previousIndex'] + 1);

            $assignments = $this->getRecordsWithUnderlyingQuery($assignments, $index, $id, $arguments);
        } else {
            // Without underlying query information, just get the record specified.
            $assignments = $this->getTheRecordSpecified($id, $assignments);
        }

        return $assignments;
    }
1160667
protected function doContains($id)
    {

        $md5Key = md5($id);

        $kvm = KVMLogger::instance('anycontent-cache');

        $hit = $this->getCacheProvider()->doContains($md5Key);

        if ($hit)
        {
            $this->hit++;
            $message = $kvm->createLogMessage('Cache hit', [ 'key' => $id, 'md5' => $md5Key, 'namespace' => $this->getNamespace() ]);
            $kvm->debug($message);
        }
        else
        {
            $this->miss++;
            $message = $kvm->createLogMessage('Cache miss', [ 'key' => $id, 'namespace' => $this->getNamespace() ]);
            $kvm->debug($message);
        }

        return $hit;
    }
1082587
public function contentId($id = null)
    {
        if ($id === null) {
            return $this->_contentId;
        }
        $this->_contentId = $id;
    }
566442
public function getSnapshots($id)
    {
        $snapshots = $this->adapter->get(sprintf('%s/droplets/%d/snapshots?per_page=%d', $this->endpoint, $id, 200));

        $snapshots = json_decode($snapshots);

        $this->meta = $this->extractMeta($snapshots);

        return array_map(function ($snapshot) {
            $snapshot = new ImageEntity($snapshot);

            return $snapshot;
        }, $snapshots->snapshots);
    }
1089674
public function getCommitComment(int $id): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments/:id',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), (string)$id));
    }
213059
public function getChildren($id): array
    {
        $result = [];
        $childrenIds = (array)($this->childrenIds[$id] ?? []);
        foreach ($childrenIds as $childId) {
            if ($child = $this->getItem($childId)) {
                $result[$childId] = $child;
            }
        }
        return $result;
    }
1333159
public function getRecipeById($id)
    {
        $result = [
            'className' => (isset($this->classNameById[$id])) ?
                $this->classNameById[$id] :
                null,
            'arguments' => (isset($this->argumentsById[$id])) ?
                $this->argumentsById[$id] :
                null,
            'constructor' => (isset($this->constructorById[$id])) ?
                $this->constructorById[$id] :
                null,
            'dependencies' => (isset($this->dependenciesById[$id])) ?
                $this->dependenciesById[$id] :
                null,
        ];

        return $result;
    }