options = new ArrayCollection(); $this->tags = new ArrayCollection(); $this->description = ''; $this->visibleToOthers = false; $this->visibleToSelf = false; $this->changeable = false; } /** * Get id. * * @return int */ public function getId() { return $this->id; } /** * @return int */ public function getExtraFieldType() { return $this->extraFieldType; } public function setExtraFieldType(int $extraFieldType): self { $this->extraFieldType = $extraFieldType; return $this; } /** * @return int */ public function getFieldType() { return $this->fieldType; } public function setFieldType(int $fieldType): self { $this->fieldType = $fieldType; return $this; } /** * @return string */ public function getVariable() { return $this->variable; } public function setVariable(string $variable): self { $this->variable = $variable; return $this; } /** * @param bool $translated Optional. Whether translate the display text * * @return string */ public function getDisplayText(bool $translated = true) { if ($translated) { return \ExtraField::translateDisplayName($this->variable, $this->displayText); } return $this->displayText; } public function setDisplayText(string $displayText): self { $this->displayText = $displayText; return $this; } /** * @return string */ public function getDefaultValue() { return $this->defaultValue; } public function setDefaultValue(string $defaultValue): self { $this->defaultValue = $defaultValue; return $this; } /** * @return int */ public function getFieldOrder() { return $this->fieldOrder; } public function setFieldOrder(int $fieldOrder): self { $this->fieldOrder = $fieldOrder; return $this; } /** * @return bool */ public function isChangeable() { return $this->changeable; } public function setChangeable(bool $changeable): self { $this->changeable = $changeable; return $this; } public function isFilter(): bool { return $this->filter; } public function setFilter(bool $filter): self { $this->filter = $filter; return $this; } public function isVisibleToSelf(): bool { return $this->visibleToSelf; } public function setVisibleToSelf(bool $visibleToSelf): self { $this->visibleToSelf = $visibleToSelf; return $this; } public function isVisibleToOthers(): bool { return $this->visibleToOthers; } public function setVisibleToOthers(bool $visibleToOthers): self { $this->visibleToOthers = $visibleToOthers; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } /** * @return ExtraFieldOptions[]|Collection */ public function getOptions() { return $this->options; } public function setOptions(Collection $options): self { $this->options = $options; return $this; } /** * @return Tag[]|Collection */ public function getTags() { return $this->tags; } public function setTags(Collection $tags): self { $this->tags = $tags; return $this; } public function getTypeToString(): string { switch ($this->getExtraFieldType()) { case \ExtraField::FIELD_TYPE_RADIO: case \ExtraField::FIELD_TYPE_SELECT: return 'choice'; case \ExtraField::FIELD_TYPE_TEXT: case \ExtraField::FIELD_TYPE_TEXTAREA: default: return 'text'; } } public function getHelperText(): string { return $this->helperText; } public function setHelperText(string $helperText): self { $this->helperText = $helperText; return $this; } }