Finds the TermOfProductType model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.

@param integer $id

@return TermOfProductType the loaded model
@throws NotFoundHttpException if the model cannot be found
174001
protected function findModel($id)
    {
        if (($model = TermOfProductType::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
345439
protected function findModel($id)
    {
        if (($model = Role::findByName($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('maddoger/user', 'The requested role does not exist.'));
        }
    }
331665
protected function findModel($id)
    {
        if (($model = Term::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
1043769
protected function findModel($id)
    {
        if (($model = Rubric::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Module::t('core', 'The requested model does not exist.'));
        }
    }
1155898
private function retrieveProductTypeIdByKey($key)
    {
        if (!isset($this->productTypesMap[$key])) {
            return null;
        }

        return intval($this->productTypesMap[$key]);
    }
1287470
protected function findModel($id)
    {
        /** @var \yii\web\IdentityInterface $class */
        $class = $this->userClassName;
        if (($user = $class::findIdentity($id)) !== null) {
            return new AdminAssignment($id, $user);
        } else {
            throw new NotFoundHttpException(Yii::t('yuncms', 'The requested page does not exist.'));
        }
    }
747803
protected function findModel($id)
    {
        /** @var Comment $model */
        $model = Address::findOne($id);
        if ($model !== null) {
            return $model;
        } else {
            throw new HttpException(404, \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_RECORD_NOT_FOUND'));
        }
    }
526241
protected function findModel($id)
    {
        /* @var $modelClass ActiveRecord */
        $modelClass = $this->modelClass;
        $keys = $modelClass::primaryKey();
        if (count($keys) > 1) {
            $values = explode(',', $id);
            if (count($keys) === count($values)) {
                $model = $modelClass::findOne(array_combine($keys, $values));
            }
        } elseif ($id !== null) {
            $model = $modelClass::findOne($id);
        }

        if (isset($model)) {
            return $model;
        } else {
            throw new NotFoundHttpException("Object not found: '$id'");
        }
    }
1276847
public function modelJsonAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        
        $brand = $em->getRepository('EcommerceBundle:Brand')->find($id);

        if (!$brand instanceof Brand){
            throw $this->createNotFoundException('Unable to find Brand entity.');
        }
            
        $entities = $em->getRepository('EcommerceBundle:BrandModel')->findByBrand($brand);

        $returnValues = array();
        foreach ($entities as $entity) {
            $returnValues[$entity->getId()] =  $entity->getName() ;
        }
        return new JsonResponse($returnValues);
    }
337827
public function getModelByPrimaryKey($id)
    {
        foreach($this->models as $model)
        {
            $primaryKey = $model->getKeyName();
            if($model->$primaryKey == $id)
                return $model;
        }
    }
465680
public function findById($id)
    {
        if (count($this->primaryKeys) > 1) {
            throw new \LogicException(__METHOD__ . '|Cannot use findById() method for table with multiple primary keys !');
        }

        $field = reset($this->primaryKeys);

        return $this->findByKeys(array($field => $id));
    }
187800
protected function getType($id)
    {
        $type = $this->attributeTypeRepository->find($id);
        if (!$type) {
            throw new EntityNotFoundException(AttributeType::class, $id);
        }

        return $type;
    }
684176
public function findOneById($id)
    {
        $persister = $this->entityManager->getEntityPersister($this->className);

        return $persister->loadOneById($id);
    }
973647
protected function findModel($id)
    {
        $commentModel = $this->getModule()->commentModelClass;
        if (null !== ($model = $commentModel::findOne($id))) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('yii2mod.comments', 'The requested page does not exist.'));
        }
    }
750471
public function find($id)
    {
        $resourceName = constant($this->type . '::RESOURCE');

        $url      = sprintf("%s/%s/%s", self::ENDPOINT, $resourceName, $id);
        $response = $this->fetch($url, substr($resourceName, 0, strlen($resourceName) - 1));

        return new $this->type($response);
    }
1207050
protected function getCustomer($id)
    {
        $customer = $this->customerManager->findOneBy(['id' => $id]);

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

        return $customer;
    }
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.');
        }
    }