FieldAttributes.php
5 years ago
FieldDefaultValue.php
5 years ago
FieldEmailTag.php
5 years ago
FieldHelpText.php
5 years ago
FieldLabel.php
5 years ago
FieldOptions.php
5 years ago
FieldReadOnly.php
5 years ago
FieldReceipt.php
5 years ago
FieldRequired.php
5 years ago
FieldStoreAsMeta.php
5 years ago
FieldTypes.php
5 years ago
FieldOptions.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Framework\FieldsAPI\FormField; |
| 4 | |
| 5 | use Give\Framework\FieldsAPI\FormField\FieldTypes; |
| 6 | |
| 7 | trait FieldOptions { |
| 8 | |
| 9 | /** @var array */ |
| 10 | protected $options = []; |
| 11 | |
| 12 | public function supportsOptions() { |
| 13 | return in_array( |
| 14 | $this->getType(), |
| 15 | [ |
| 16 | FieldTypes::TYPE_SELECT, |
| 17 | FieldTypes::TYPE_RADIO, |
| 18 | ] |
| 19 | ); |
| 20 | } |
| 21 | |
| 22 | public function options( $options ) { |
| 23 | $this->options = $options; |
| 24 | return $this; |
| 25 | } |
| 26 | |
| 27 | public function getOptions() { |
| 28 | return $this->options; |
| 29 | } |
| 30 | } |
| 31 |