| 1 | <?php |
||
| 9 | class FieldValue extends ValueObject |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var int |
||
| 13 | * |
||
| 14 | * previous $contentClassAttributeId |
||
| 15 | */ |
||
| 16 | protected $fieldDefinitionId; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var float |
||
| 20 | */ |
||
| 21 | protected $dataFloat = 0.0; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var int |
||
| 25 | */ |
||
| 26 | protected $dataInt = 0; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | protected $dataText = ''; |
||
| 32 | |||
| 33 | public function __construct(int $fieldDefinitionId, string $dataText, int $dataInt = 0, float $dataFloat = 0.0) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return int |
||
| 43 | */ |
||
| 44 | public function getFieldDefinitionId(): int |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return float |
||
| 51 | */ |
||
| 52 | public function getDataFloat(): float |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return int |
||
| 59 | */ |
||
| 60 | public function getDataInt(): int |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | public function getDataText(): string |
||
| 72 | |||
| 73 | public static function withStringValue(int $fieldDefinitionId, string $dataText): self |
||
| 80 | |||
| 81 | public static function withIntValue(int $fieldDefinitionId, int $dataInt): self |
||
| 89 | |||
| 90 | public static function withFloatValue(int $fieldDefinitionId, float $dataFloat): self |
||
| 99 | } |
||
| 100 |