*/ protected array $choices; protected bool $isFieldExist; protected string $displayFormat; protected bool $isMultiple; protected bool $isRepeater; protected ?FieldMetaInterface $selfRepeatableMeta; /** * @var string|string[] */ protected $defaultValue; /** * @var array */ protected array $customArgs; protected int $zoom; protected string $centerLat; protected string $centerLng; public function __construct(string $vendorName, string $fieldId) { $this->vendorName = $vendorName; $this->fieldId = $fieldId; $this->name = ''; $this->type = ''; $this->returnFormat = ''; $this->choices = []; $this->isFieldExist = false; $this->displayFormat = ''; $this->isMultiple = false; $this->isRepeater = false; $this->selfRepeatableMeta = null; $this->defaultValue = ''; $this->customArgs = []; $this->zoom = 0; $this->centerLat = ''; $this->centerLng = ''; } public function isFieldExist(): bool { return $this->isFieldExist; } public function getFieldId(): string { return $this->fieldId; } public function getName(): string { return $this->name; } public function getType(): string { return $this->type; } /** * @return mixed */ public function getCustomArg(string $argName) { return $this->customArgs[$argName] ?? null; } /** * @param mixed $argValue */ public function setCustomArg(string $argName, $argValue): void { $this->customArgs[$argName] = $argValue; } public function unsetCustomArg(string $argName): void { if (!key_exists($argName, $this->customArgs)) { return; } unset($this->customArgs[$argName]); } public function getReturnFormat(): string { return $this->returnFormat; } public function getDisplayFormat(): string { return $this->displayFormat; } /** * @return array */ public function getChoices(): array { return $this->choices; } public function isMultiple(): bool { return $this->isMultiple; } public function isRepeater(): bool { return $this->isRepeater; } public function getSelfRepeatableMeta(): ?FieldMetaInterface { return $this->selfRepeatableMeta; } /** * @return string|string[] */ public function getDefaultValue() { return $this->defaultValue; } public function getZoom(): int { return $this->zoom; } public function getCenterLat(): string { return $this->centerLat; } public function getCenterLng(): string { return $this->centerLng; } public function getVendorName(): string { return $this->vendorName; } //// setters public function setIsFieldExist(bool $isFieldExist): void { $this->isFieldExist = $isFieldExist; } public function setName(string $name): void { $this->name = $name; } public function setType(string $type): void { $this->type = $type; } public function setReturnFormat(string $returnFormat): void { $this->returnFormat = $returnFormat; } public function setDisplayFormat(string $displayFormat): void { $this->displayFormat = $displayFormat; } /** * @param array $choices */ public function setChoices(array $choices): void { $this->choices = $choices; } public function setIsMultiple(bool $isMultiple): void { $this->isMultiple = $isMultiple; } public function setIsRepeater(bool $isRepeater): void { $this->isRepeater = $isRepeater; } public function setSelfRepeatableMeta(?FieldMetaInterface $selfRepeatableMeta): void { $this->selfRepeatableMeta = $selfRepeatableMeta; } /** * @param string|string[] $defaultValue */ public function setDefaultValue($defaultValue): void { $this->defaultValue = $defaultValue; } public function setZoom(int $zoom): void { $this->zoom = $zoom; } public function setCenterLat(string $centerLat): void { $this->centerLat = $centerLat; } public function setCenterLng(string $centerLng): void { $this->centerLng = $centerLng; } }