Find model by ID.

@param integer|array $id Model ID

@return TaxonomyVocabulary

@throws HttpException 404 error if model not found
509028
protected function findModel($id)
    {
        if (is_array($id)) {
            $model = TaxonomyVocabulary::findAll($id);
        } else {
            $model = TaxonomyVocabulary::findOne($id);
        }
        if ($model !== null) {
            return $model;
        } else {
            throw new HttpException(404);
        }
    }
1343314
public function find($id)
    {
        if (! is_numeric($id) && is_string($id)) {
            return $this->findBySlug($id);
        }

        return $this->plugger
            ->setModel($this)
            ->setAdapter(Post::class)
            ->plugIn(get_post($id))
            ->getConnected()
            ->first();
    }
952750
public function getById($id)
    {
        $modelResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl(sprintf('models/%s', $id))
        );

        return $this->getModelFromResult($modelResult);
    }
339506
public function findModel($id = null)
    {
        if ($id === null) {
            return new Item();
        }
        if (($model = Item::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('modules/page', 'The requested page does not exist.'));
        }
    }
565748
public function find($id)
    {
        $response = $this->ontraport->get(
            $this->getSingularNamespace(), $this->toArray(compact('id'))
        );

        return $this->ontraport->item($this, $response);
    }
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.'));
        }
    }
322003
public function findById($id)
    {
        $entity = $this->getEntityManager()->getRepository($this->entityClass);
        return $entity->find($id);
    }
1087080
public function get($id, $args = [])
    {
        $term = get_term($id, $args['taxonomy']);

        if (! $term) {
            throw new UnexpectedValueException(sprintf('[W610] Could not find term with ID %d', $id));
        } elseif (is_wp_error($term)) {
            throw new UnexpectedValueException(
                sprintf('[W610] Could not find term with ID %d: %s', $id, $term->get_error_message())
            );
        }

        return $term;
    }
743455
protected function findModel($id)
    {
        $auth = Configs::authManager();
        $item = $this->type === Item::TYPE_ROLE ? $auth->getRole($id) : $auth->getPermission($id);
        if ($item) {
            return new AuthItem($item);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
590329
public function findByIntOrFail(int $id): Model
    {
        $model = $this->findByInt($id);
        if (empty($model)) {
            throw new ResourceNotFoundException();
        }

        return $model;
    }
421924
public function actionView($id)
	{
		//get the model, to use it within the meta tags
		$model = $this->findModel($id);
		//setting the meta keywords for this page
		$tok = new ClassifierBasedTokenizer(
	    new EndOfSentence(),
	    new WhitespaceTokenizer()
		);
		$text = strip_tags($model->content);
		$sentences = $tok->tokenize($text);
		if(is_array($sentences) && array_key_exists(0, $sentences))
		{			
			$this->view->registerMetaTag(
	            [
	                'name'    => 'metadescription',
	                'content' => $model->title . ' ' . substr($sentences[0],0,100)
	            ],
	            'keywords'
	        );
		}
		else{
			$this->view->registerMetaTag(
	            [
	                'name'    => 'metadescription',
	                'content' => $model->title . ' ' . $text
	            ],
	            'keywords'
	        );
		}

		$this->view->registerMetaTag(
            [
                'name'    => 'metakeywords',
                'content' => $model->tags
            ],
            'keywords'
        );

		return $this->render('onlineview', [
			'model' => $model,
		]);
	}
301000
protected function find($id)
    {
        $model = $this->model;
        $this->model = $model::find($id);
        if (!$this->model) {
            // belts and braces check - no model = doesn't exist (without being masked missing object property)
            // potential candidate for custom exception handling
            return false;
        }
        return $this->model->exists;
    }
813155
public static function find($id) { 
        $array = KernelDB::find(static::$model, $id);
        $routeModel = Dir::apiModel(static::$model);
        return self::arrayToModel($routeModel, $array);
    }
147007
protected function getModel ($id) {
		return isset ($this->models[$id]) ? $this->models[$id] : null;
	}
12975
protected function loadModel($id)
    {
        // Если модель не определена
        if (!$this->model) {
            // Определяем модель в соответствии с переданным именем класса
            $this->model = call_user_func([$this->modelClass, 'findOne'], [$id]);
        }

        // Определяем переданные поля
        $this->model->setAttributes($this->attributes);

        // Если модель не найдена, генерим Exception
        if ($this->model === null)
            throw new HttpException(404, 'Model not found');

        return $this->model;
    }
355798
public function find($id, array $with = [])
    {
        $key = $this->getKey($id, $with);

        $tags = $this->getTags($id, $with);

        if ($this->cache->has($key, $tags)) {
            return $this->cache->get($key, $tags);
        }

        $model = $this->repo->find($id, $with);

        $this->cache->put($key, $model, $tags);

        return $model;
    }
239342
protected function findModel($id)
    {
        $class = $this->modelClass;
        if (($model = $class::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }