entity = $entity; $this->name = $name; $this->setDataType($dataType); } /** * @return mixed */ public function getDefaultValue() { return $this->defaultValue; } /** * @param mixed $defaultValue * * @return $this */ public function setDefaultValue($defaultValue) { $this->defaultValue = $defaultValue; return $this; } /** * @param string $entity * * @return $this */ public function setEntity($entity) { $this->entity = $entity; return $this; } /** * @return string */ public function getEntity() { return $this->entity; } /** * @return bool */ public function isRequired() { return $this->required; } /** * @param bool $required * * @return $this */ public function setRequired($required) { $this->required = $required; return $this; } /** * @return bool */ public function getRequiredIf() { return $this->requiredIf; } /** * @param bool $requiredIf * * @return $this */ public function setRequiredIf($requiredIf) { $this->requiredIf = $requiredIf; return $this; } /** * @param array $permission * @return $this */ public function setPermission($permission) { $this->permission = $permission; return $this; } /** * @return array */ public function getPermission() { return $this->permission; } /** * @param callable[] $outputFormatters * @return $this */ public function setOutputFormatters($outputFormatters) { $this->outputFormatters = $outputFormatters; return $this; } /** * @param callable $outputFormatter * @return $this */ public function addOutputFormatter($outputFormatter) { if (!$this->outputFormatters) { $this->outputFormatters = []; } $this->outputFormatters[] = $outputFormatter; return $this; } /** * @param string $type * @return $this */ public function setType(string $type) { $this->type = $type; return $this; } /** * @param bool $readonly * @return $this */ public function setReadonly($readonly) { $this->readonly = (bool) $readonly; return $this; } }