public function loadState(array $params) { parent::loadState($params); if (!isset($params['web']) || !($this->web = $this->repository->getBy(['alias' => $params['web']]))) { $this->error(); } }
public function actionEdit(string $id) { if (!($this->entity = $this->repository->getById($id))) { $this->error(); } }