| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait BlockNameTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param string $name |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#block-name |
|
| 13 | */ |
|
| 14 | public function setBlockName($name) |
|
| 15 | { |
|
| 16 | return $this->setOption('block_name', $name); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#block-name |
|
| 22 | */ |
|
| 23 | public function getBlockName() |
|
| 24 | { |
|
| 25 | return $this->getOption('block_name'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#block-name |
|
| 31 | */ |
|
| 32 | public function removeBlockName() |
|
| 33 | { |
|
| 34 | return $this->removeOption('block_name'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait ByReferenceTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param bool $byReference |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/collection.html#by-reference |
|
| 13 | */ |
|
| 14 | public function setByReference($byReference = true) |
|
| 15 | { |
|
| 16 | return $this->setOption('by_reference', $byReference); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return bool|string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/collection.html#by-reference |
|
| 22 | */ |
|
| 23 | public function getByReference() |
|
| 24 | { |
|
| 25 | return $this->getOption('by_reference'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/collection.html#by-reference |
|
| 31 | */ |
|
| 32 | public function removeByReference() |
|
| 33 | { |
|
| 34 | return $this->removeOption('by_reference'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait CompoundTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param bool $compound |
|
| 11 | * @return bool |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#compound |
|
| 13 | */ |
|
| 14 | public function setCompound($compound = true) |
|
| 15 | { |
|
| 16 | return $this->setOption('compound', $compound); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return bool|string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#compound |
|
| 22 | */ |
|
| 23 | public function getCompound() |
|
| 24 | { |
|
| 25 | return $this->getOption('compound'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return bool |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#compound |
|
| 31 | */ |
|
| 32 | public function removeCompound() |
|
| 33 | { |
|
| 34 | return $this->removeOption('compound'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait DataClassTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param string $class |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#data-class |
|
| 13 | */ |
|
| 14 | public function setDataClass($class) |
|
| 15 | { |
|
| 16 | return $this->setOption('data_class', $class); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#data-class |
|
| 22 | */ |
|
| 23 | public function getDataClass() |
|
| 24 | { |
|
| 25 | return $this->getOption('data_class'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#data-class |
|
| 31 | */ |
|
| 32 | public function removeDataClass() |
|
| 33 | { |
|
| 34 | return $this->removeOption('data_class'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait DataTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param mixed $data |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#data |
|
| 13 | */ |
|
| 14 | public function setData($data) |
|
| 15 | { |
|
| 16 | return $this->setOption('data', $data); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return mixed |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#data |
|
| 22 | */ |
|
| 23 | public function getData() |
|
| 24 | { |
|
| 25 | return $this->getOption('data'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#data |
|
| 31 | */ |
|
| 32 | public function removeData() |
|
| 33 | { |
|
| 34 | return $this->removeOption('data'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait DisabledTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param bool $disabled |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#disabled |
|
| 13 | */ |
|
| 14 | public function setDisabled($disabled = true) |
|
| 15 | { |
|
| 16 | return $this->setOption('disabled', $disabled); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return bool|string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#disabled |
|
| 22 | */ |
|
| 23 | public function getDisabled() |
|
| 24 | { |
|
| 25 | return $this->getOption('disabled'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#disabled |
|
| 31 | */ |
|
| 32 | public function removeDisabled() |
|
| 33 | { |
|
| 34 | return $this->removeOption('disabled'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait EmptyDataTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param mixed $data |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#empty-data |
|
| 13 | */ |
|
| 14 | public function setEmptyData($data) |
|
| 15 | { |
|
| 16 | return $this->setOption('empty_data', $data); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return mixed |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#empty-data |
|
| 22 | */ |
|
| 23 | public function getEmptyData() |
|
| 24 | { |
|
| 25 | return $this->getOption('empty_data'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#empty-data |
|
| 31 | */ |
|
| 32 | public function removeEmptyData() |
|
| 33 | { |
|
| 34 | return $this->removeOption('empty_data'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-35 (lines=31) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait ErrorBubblingTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param bool $errorBubbling |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#error-bubbling |
|
| 13 | */ |
|
| 14 | public function setErrorBubbling($errorBubbling = true) |
|
| 15 | { |
|
| 16 | return $this->setOption('error_bubbling', $errorBubbling); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return bool|string |
|
| 21 | */ |
|
| 22 | public function getErrorBubbling() |
|
| 23 | { |
|
| 24 | return $this->getOption('error_bubbling'); |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @return $this |
|
| 29 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#error-bubbling |
|
| 30 | */ |
|
| 31 | public function removeErrorBubbling() |
|
| 32 | { |
|
| 33 | return $this->removeOption('error_bubbling'); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait ExtraFieldsMessageTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param string $message |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#extra-fields-message |
|
| 13 | */ |
|
| 14 | public function setExtraFieldsMessage($message) |
|
| 15 | { |
|
| 16 | return $this->setOption('extra_fields_message', $message); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#extra-fields-message |
|
| 22 | */ |
|
| 23 | public function getExtraFieldsMessage() |
|
| 24 | { |
|
| 25 | return $this->getOption('extra_fields_message'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#extra-fields-message |
|
| 31 | */ |
|
| 32 | public function removeExtraFieldsMessage() |
|
| 33 | { |
|
| 34 | return $this->removeOption('extra_fields_message'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait InheritDataTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param bool|string $inherit |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#inherit-data |
|
| 13 | */ |
|
| 14 | public function setInheritData($inherit = true) |
|
| 15 | { |
|
| 16 | return $this->setOption('inherit_data', $inherit); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return bool|string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#inherit-data |
|
| 22 | */ |
|
| 23 | public function getInheritData() |
|
| 24 | { |
|
| 25 | return $this->getOption('inherit_data'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#inherit-data |
|
| 31 | */ |
|
| 32 | public function removeInheritData() |
|
| 33 | { |
|
| 34 | return $this->removeOption('inherit_data'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait InvalidMessageParametersTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param array $parameters |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#invalid-message-parameters |
|
| 13 | */ |
|
| 14 | public function setInvalidMessageParameters(array $parameters) |
|
| 15 | { |
|
| 16 | return $this->setOption('invalid_message_parameters', $parameters); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return array |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#invalid-message-parameters |
|
| 22 | */ |
|
| 23 | public function getInvalidMessageParameters() |
|
| 24 | { |
|
| 25 | return $this->getOption('invalid_message_parameters'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#invalid-message-parameters |
|
| 31 | */ |
|
| 32 | public function removeInvalidMessageParameters() |
|
| 33 | { |
|
| 34 | return $this->removeOption('invalid_message_parameters'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait InvalidMessageTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param string $message |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#invalid-message |
|
| 13 | */ |
|
| 14 | public function setInvalidMessage($message) |
|
| 15 | { |
|
| 16 | return $this->setOption('invalid_message', $message); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#invalid-message |
|
| 22 | */ |
|
| 23 | public function getInvalidMessage() |
|
| 24 | { |
|
| 25 | return $this->getOption('invalid_message'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#invalid-message |
|
| 31 | */ |
|
| 32 | public function removeInvalidMessage() |
|
| 33 | { |
|
| 34 | return $this->removeOption('invalid_message'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait LabelAttrTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param array $attr |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#label-attr |
|
| 13 | */ |
|
| 14 | public function setLabelAttr(array $attr) |
|
| 15 | { |
|
| 16 | return $this->setOption('label_attr', $attr); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return array|string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#label-attr |
|
| 22 | */ |
|
| 23 | public function getLabelAttr() |
|
| 24 | { |
|
| 25 | return $this->getOption('label_attr'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#label-attr |
|
| 31 | */ |
|
| 32 | public function removeLabelAttr() |
|
| 33 | { |
|
| 34 | return $this->removeOption('label_attr'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-39 (lines=35) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait LabelFormatTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param string $format |
|
| 11 | * @return $this |
|
| 12 | * @link https://github.com/symfony/symfony-docs/pull/5642 |
|
| 13 | * @since 2.6 |
|
| 14 | */ |
|
| 15 | public function setLabelFormat($format) |
|
| 16 | { |
|
| 17 | return $this->setOption('label_format', $format); |
|
| 18 | } |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @return string |
|
| 22 | * @link https://github.com/symfony/symfony-docs/pull/5642 |
|
| 23 | * @since 2.6 |
|
| 24 | */ |
|
| 25 | public function getLabelFormat() |
|
| 26 | { |
|
| 27 | return $this->getOption('label_format'); |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @return $this |
|
| 32 | * @link https://github.com/symfony/symfony-docs/pull/5642 |
|
| 33 | * @since 2.6 |
|
| 34 | */ |
|
| 35 | public function removeLabelFormat() |
|
| 36 | { |
|
| 37 | return $this->removeOption('label_format'); |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait MappedTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param bool|string $mapped |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#mapped |
|
| 13 | */ |
|
| 14 | public function setMapped($mapped = true) |
|
| 15 | { |
|
| 16 | return $this->setOption('mapped', $mapped); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return bool|string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#mapped |
|
| 22 | */ |
|
| 23 | public function getMapped() |
|
| 24 | { |
|
| 25 | return $this->getOption('mapped'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#mapped |
|
| 31 | */ |
|
| 32 | public function removeMapped() |
|
| 33 | { |
|
| 34 | return $this->removeOption('mapped'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait PropertyPathTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param string $path |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#property-path |
|
| 13 | */ |
|
| 14 | public function setPropertyPath($path) |
|
| 15 | { |
|
| 16 | return $this->setOption('property_path', $path); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#property-path |
|
| 22 | */ |
|
| 23 | public function getPropertyPath() |
|
| 24 | { |
|
| 25 | return $this->getOption('property_path'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#property-path |
|
| 31 | */ |
|
| 32 | public function removePropertyPath() |
|
| 33 | { |
|
| 34 | return $this->removeOption('property_path'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait RequiredTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param bool $required |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#required |
|
| 13 | */ |
|
| 14 | public function setRequired($required = true) |
|
| 15 | { |
|
| 16 | return $this->setOption('required', $required); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return bool|string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#required |
|
| 22 | */ |
|
| 23 | public function getRequired() |
|
| 24 | { |
|
| 25 | return $this->getOption('required'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#required |
|
| 31 | */ |
|
| 32 | public function removeRequired() |
|
| 33 | { |
|
| 34 | return $this->removeOption('required'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait TranslationDomainTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param string|false $domain |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#translation-domain |
|
| 13 | */ |
|
| 14 | public function setTranslationDomain($domain) |
|
| 15 | { |
|
| 16 | return $this->setOption('translation_domain', $domain); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return string|false |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#translation-domain |
|
| 22 | */ |
|
| 23 | public function getTranslationDomain() |
|
| 24 | { |
|
| 25 | return $this->getOption('translation_domain'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#translation-domain |
|
| 31 | */ |
|
| 32 | public function removeTranslationDomain() |
|
| 33 | { |
|
| 34 | return $this->removeOption('translation_domain'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace steevanb\SymfonyFormOptionsBuilder\Behavior; |
|
| 4 | ||
| 5 | trait TrimTrait |
|
| 6 | { |
|
| 7 | use OptionAccessorsTrait; |
|
| 8 | ||
| 9 | /** |
|
| 10 | * @param bool $trim |
|
| 11 | * @return $this |
|
| 12 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#trim |
|
| 13 | */ |
|
| 14 | public function setTrim($trim = true) |
|
| 15 | { |
|
| 16 | return $this->setOption('trim', $trim); |
|
| 17 | } |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @return bool|string |
|
| 21 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#trim |
|
| 22 | */ |
|
| 23 | public function getTrim() |
|
| 24 | { |
|
| 25 | return $this->getOption('trim'); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return $this |
|
| 30 | * @link http://symfony.com/doc/current/reference/forms/types/form.html#trim |
|
| 31 | */ |
|
| 32 | public function removeTrim() |
|
| 33 | { |
|
| 34 | return $this->removeOption('trim'); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||