public function setEntity(Base $entity) { parent::setEntity($entity); $parameters = $this->initialParameters; unset($parameters['expression']); $this->valueField = $this->entity->initializeField($this->name, $parameters); if (!$this->valueField instanceof ScalarField) { throw new SystemException('expression field can only be a scalar type.'); } }