Get the template by ID

@param int $id template ID
@return XiboLayout
@throws XiboApiException
326923
public function getByTemplateId($id)
    {
        $this->getLogger()->info('Getting template ID ' . $this->templateId);
        $response = $this->doGet('/template', [
            'templateId' => $id
        ]);

        if (count($response) <= 0)
            throw new XiboApiException('Expecting a single record, found ' . count($response));

        $this->getLogger()->debug('Passing the response to Hydrate');
        return $this->hydrate($response[0]);
    }
434829
protected function getPage($id)
    {
        $page = $this->pageManager->findOneBy(['id' => $id]);

        if (null === $page) {
            throw new NotFoundHttpException(sprintf('Page (%d) not found', $id));
        }

        return $page;
    }
132009
public function get($id)
    {
        $response = $this->mailjet->get(Resources::$Template, ['id' => $id]);
        if (!$response->success()) {
            $this->throwError("TemplateService:get() failed", $response);
        }

        return $response->getData();
    }
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));
    }
1225658
public function getById($id)
    {
		$repo   = $this->getRepository('erdiko\users\entities\User');
		$result = $repo->findOneBy(array('id' => $id ));

		return $result;
	}
415591
public function getTemplate($id)
    {
        // Default system wide template wrapping config
        $wrapTemplate = Primer::$WRAP_TEMPLATES;

        $id = Primer::cleanId($id);

        // Create the template
        $template = new Pattern('templates/' . $id);

        $templateData = new ViewData([
            "primer" => [
                'bodyClass' => 'is-template',
                'template' => $id,
            ],
        ]);

        $data = $template->getData();

        // Template level wrapping config
        if (isset($data->primer->wrapTemplate)) {
            $wrapTemplate = $data->primer->wrapTemplate;
        }

        if ($wrapTemplate) {
            $view = 'template';

            // Check the data to see if there is a custom view
            if (isset($data->primer) && isset($data->primer->view)) {
                $view = $data->primer->view;
            }

            $templateData->primer->items = $template->render(false);

            Event::fire('render', $templateData);

            return View::render($view, $templateData);
        } else {
            // Merge the data we would have passed into the view into the template
            $template->setData($templateData);

            // Get a reference to the template data so that we can pass it to anyone who's listening
            $viewData = $template->getData();
            Event::fire('render', $viewData);

            return $template->render(false);
        }
    }
1061883
public function getById($id)
    {
        $ip = $this->adapter->get(sprintf('%s/floating_ips/%s', $this->endpoint, $id));

        $ip = json_decode($ip);

        return new FloatingIpEntity($ip->floating_ip);
    }
915027
public static function getById($id)
    {
        $result = null;
        $info = CldrData::getLanguageInfo($id);
        if (isset($info)) {
            $result = new Language($info);
        }

        return $result;
    }
209458
public static function read_template($id) {
        static::require_enabled();
        $template = new template($id);
        $context = $template->get_context();

        // First we do a permissions check.
        if (!$template->can_read()) {
             throw new required_capability_exception($template->get_context(), 'moodle/competency:templateview',
                'nopermissions', '');
        }

        // OK - all set.
        return $template;
    }
512150
public function getTemplate($id, $context = Theme::CONTEXT_BACKOFFICE)
    {
        $templates = $this->getOption(static::TEMPLATES);

        if (is_null($templates) || empty($templates[$id])) {
            return Template::getTemplate('blocks/' . $id . '.tpl', 'tao');
        }

        if ($templates[$id] === static::DEFAULT_PATH) {
            return Template::getTemplate(
                $this->defaultThemePath . '/' . $id . '.tpl',
                $this->getOption(static::EXTENSION_ID)
            );
        }

        // otherwise it will be assumed the template is already configured
        return $templates[$id];
    }
1213219
public function getAction($id)
    {
        $view = $this->responseGetById(
            $id,
            function($id) {
                return $this->getDoctrine()
                    ->getRepository(self::$entityName)
                    ->find($id);
            }
        );

        return $this->handleView($view);
    }
1273171
public function getParameterByID($id)
    {
        $param = current(array_filter($this->params, function (Param $param) use ($id) {
            return ($param->id === $id);
        }));

        return ($param) ? $param : null;
    }
1041619
public static function getByID($id)
    {
        if ($id) {
            $app = Application::getFacadeApplication();
            $em = $app->make(EntityManagerInterface::class);
            $result = $em->find(ThumbnailTypeEntity::class, $id);
        } else {
            $result = null;
        }

        return $result;
    }
994970
public function get($id)
    {
        $site = $this->getCurrentSite();

        $result = $this->buildSiteApiResponse($site);

        return new ApiJsonModel($result, 0, 'Success');
    }
601773
public function fetchById($id)
    {
        if ($this->hasCache()) {
            $data = $this->getCacheItem($id);
            return $data;
        }
        return parent::fetchById($id);
    }
1366236
public function getById($id)
    {
        $droplet = $this->adapter->get(sprintf('%s/droplets/%d', $this->endpoint, $id));

        $droplet = json_decode($droplet);

        return new DropletEntity($droplet->droplet);
    }
1159185
public function getApiApp($id)
    {
        $params = array();
        $response = $this->rest->get(
            static::APIAPP_PATH . '/' . $id,
            $params
        );
        $this->checkResponse($response);
        return new ApiApp($response);
    }