@param int $id

@return ModelInterface
330884
private function findOr404Error($id)
    {
        $translator = $this->get('translator');
        $translationDomain = $this->getParameter('symfonyid.admin.translation_domain');

        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $modelClass = $crudConfigurator->getCrud()->getModelClass();
        $driver = $this->get('symfonyid.admin.manager.driver_finder')->findDriverForClass($modelClass);
        $crudOperationHandler = $this->get('symfonyid.admin.crud.crud_operation_handler');

        /** @var ModelInterface $model */
        $model = $crudOperationHandler->find($driver, $modelClass, $id);
        if (!$model) {
            throw new NotFoundHttpException($translator->trans('message.data_not_found', array('%id%' => $id), $translationDomain));
        }

        return $model;
    }
466577
public function Person(int $id): Model\Person\Person
    {
        return $this->myanimelist->getPerson(
            new Request\Person\PersonRequest($id)
        );
    }
1285454
public function actionCreate($id)
    {
        $model = new Item();
        $model->pid = $id;
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('modules/page', 'Success'));
            return $this->redirect(['update', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
1009848
public function setId(?int $id): User
    {
        Assert::greaterThan($id, 0);

        $this->id = $id;

        return $this;
    }
450560
public function train(string $id)
    {
        $modelResult = $this->getRequest()->request(
            'POST',
            $this->getRequestUrl(sprintf('models/%s/versions', $id))
        );

        return $this->getModelFromResult($modelResult);
    }
530860
public function delete($id)
    {
        $this->applyScope();

        $model = $this->find($id);
        $originalModel = clone $model;

        $this->resetModel();

        $deleted = $model->delete();

        event(new RepositoryEntityDeleted($this, $originalModel));

        return $deleted;
    }
759486
public function actionView(string $id)
    {
        $model = $this->findModel($id);

        return $this->render('view', ['model' => $model]);
    }
162543
protected function loadModel($id = null)
	{
		/** @var BaseActiveRecord $modelClass */
		$modelClass = $this->modelClass();
		if($id) {
			$this->modelInstance = $modelClass::findOne($id);
		} else {
			$this->modelInstance = new $modelClass();
		}
		$this->modelInstance->load($this->attributes, '');
		return $this->modelInstance;
	}
38380
public function destroy($id)
    {
        $this->model = $this->model->findOrFail($id);

        $this->runChecks('destroy', $this->model->toArray());

        return $this->model->delete();
    }
439231
public function edit(int $id)
    {
        try {
            $address = Auth::user()->findAddress($id);
        } catch(\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
            return $this->respondsWithError(trans('address.errors.model_not_found'));
        }

        return view('address.form_edit', compact('address'));
    }
1326851
public function delete(int $id)
    {
        $this->cache->tags($this->getModel())->flush();
        return $this->repository->delete($id);
    }
337827
public function getModelByPrimaryKey($id)
    {
        foreach($this->models as $model)
        {
            $primaryKey = $model->getKeyName();
            if($model->$primaryKey == $id)
                return $model;
        }
    }
751176
public function getOrFail($id)
    {
        if ($model = $this->get($id)) {
            return $model;
        }

        throw (new NotFoundException("No results for id $id"))->setModel(get_class($this->model));
    }
660349
public function getSingle($id)
    {
        /** @var \SymfonyId\AdminBundle\Configuration\ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $this->isGrantedOr404Error($crudConfigurator, Constants::ACTION_READ);

        /** @var ModelInterface $model */
        $model = $this->findOr404Error($id);

        return $this->createResponse($model);
    }
1294984
public function findOrFail($id)
    {
        if ($model = $this->find($id)) {
            return $model;
        }
        throw (new ModelNotFoundException)->setModel(get_class($this->getModel()));
    }
1207567
protected function findModel($id)
    {
        if (($model = TermType::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(t('app', 'The requested page does not exist.'));
        }
    }
1226662
public function save($id = null): Model
	{
		$id = $id ?? $this->getInputId();

		if ($id) {
			return $this->update($id);
		}

		return $this->create();
	}