/** * prepareExecute * * @return void * * @throws \LogicException * @throws \DomainException */ protected function prepareExecute() { parent::prepareExecute(); $this->model = $this->getModel(); $this->dataObject = $this->getDataObject(); $this->task = $this->input->get('task'); // Determine model if (!$this->model instanceof CrudRepositoryInterface) { throw new \DomainException(sprintf('%s model should be instance of %s, class: %s', $this->model->getName(), CrudRepositoryInterface::class, get_class($this->model))); } // Determine the name of the primary key for the data. if (empty($this->keyName)) { $this->keyName = $this->model->getKeyName(false) ?: 'id'; } $this->checkAccess($this->dataObject); }