@param string $id

@return PageInterface|null
437970
public function findById($id)
    {
        foreach ($this->items as $page) {
            if ($page->getId() == $id) {
                return $page;
            } else if ($found = $page->getPages()->findById($id)) {
                return $found;
            }
        }
    }
889990
public function view($id)
    {
        $component = $this->processor->view($id);

        return response($component['component']->__toString(), 200);
    }
845344
public function index($id = null)
    {
        // process v1.authors.books route
        if ('v1.authors.books' === \Route::currentRouteName()) {
            return json()->setMeta($this->meta)->withPagination(
                Author::find($id)->books()->latest()->paginate(5),
                new BookTransformer
            );
        }

        // Respond with pagination
        return json()->setMeta($this->meta)->withPagination(
            $this->model->latest()->paginate(5),
            new BookTransformer
        );

        // Respond as a collection
        //return json()->setMeta($this->meta)->withCollection(
        //    $this->model->latest()->get(),
        //    new BookTransformer
        //);
    }
640185
public function handleDelete(int $id = null)
    {
        if ($id === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('navigations-page') . "?m=4");
            } else {
                return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=4";
            }
        }
        $navigation = $this->core->api('Navigation/' . $id, 'DELETE')->run();
        if ($navigation['headers'][0][2] === 422) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('navigations-page') . "?m=4");
            } else {
                return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=4";
            }
        } elseif (($navigation["headers"][0][2] - 200) * ($navigation["headers"][0][2] - 299) > 0) {
            return $this->templates->render("500", [
                "error" => $navigation['response'],
                "result" => ''
            ]);
        }

        if (isset($_GET['template']) === false) {
            return redirect($this->router->generate('navigations-page') . "?m=3");
        } else {
            return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=3";
        }
    }
966283
public function getElementById($id)
    {
        foreach ($this->getRecursiveIterator() as $element) {
            if ($id == $element->getId()) {
                return $element;
            }
        }
        return null;
    }
1134220
public function peek(string $id)
    {
        if (!isset($this->registered[$id])){
            return null;
        }
        return isset($this->instances[$id]) ? $this->instances[$id] : null;
    }
1090980
protected function findModel($id)
    {
        $model = $this->module->model('Content')->findOne($id);
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
662687
public function offsetGet($id)
    {
        if (!isset($this->registered[$id])){
            return null;
        }
        if (isset($this->instances[$id])){
            return $this->instances[$id];
        }
        // create new object via factory
        $factory = $this->factories[$id];
        if (!$factory || !is_callable($factory) || !method_exists($factory, '__invoke')){
            return null;
        }
        // get current slot
        $slot = $this->slots[$id] ?? new Slot($id);
        // callback factory to get new instance
        $newInstance = $this->callbackFactory($id, $slot, $factory);
        // replace instance
        $this->replaceInstance($id, $slot, $newInstance);
        return $newInstance;
    }
108846
public function load($id)
    {
        $procedure = $this->procedureFactory->createProcedure();
        $procedure->setTemplate(
            $this->loadTemplate($id)
        );

        return $procedure;
    }
1344636
public function find($id) {
        if ((string)$this->id === (string)$id) {
            return $this;
        }
        foreach ($this->subtree as $tab) {
            if ($obj = $tab->find($id)) {
                return $obj;
            }
        }
        return null;
    }
692805
public function index($id)
    {
        $this->authorize('readList', Content::class);
        $input   = $this->validator->validate('list');
        $params  = $this->processor->process($input)->getProcessedFields();
        $content = $this->repository->getById($id);
        if (!empty($content)) {
            $results = $this->repository->getTranslations(
                $content,
                $params['filter'],
                $params['orderBy'],
                $params['page'],
                $params['perPage']
            );
            return $this->respondWithSuccess($results, new ContentTranslationTransformer);
        } else {
            return $this->respondNotFound();
        }
    }
583300
public function get($id)
    {
        $resolved = $this->getResolved($id);

        return $resolved ? $resolved->getInnerExtension() : null;
    }
307087
public function getServiceById($id)
    {
        if ($name = $this->getServiceNameById($id)) {
            return $this->getService($name);
        }

        return null;
    }
1047397
public function get($id)
    {
        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->getActiveTemplateSections($id)
        );
    }
978840
public static function findById($id)
    {
        if (!$id || strlen($id) != 24) {
            return null;
        }
        $instance = static::entity()->get(get_called_class(), $id);
        if ($instance) {
            return $instance;
        }
        $mongo = static::entity()->getDatabase();
        $data = $mongo->findOne(static::$collection, ['_id' => $mongo->id($id)]);
        if (!$data) {
            return null;
        }
        $instance = new static;
        $data['__webiny_db__'] = true;
        $instance->populate($data);

        return static::entity()->add($instance);
    }
971172
public function getForm($id)
    {
        return (isset($this->forms[$id])) ? $this->forms[$id] : null;
    }
1351711
protected function findModel($id)
    {
        if (($model = Contact::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }