| @@ 7-39 (lines=33) @@ | ||
| 4 | ||
| 5 | namespace Saxulum\ElasticSearchQueryBuilder\Node; |
|
| 6 | ||
| 7 | final class BoolNode extends AbstractNode |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @var bool|null |
|
| 11 | */ |
|
| 12 | private $value; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @param bool|null $value |
|
| 16 | * @param bool |
|
| 17 | */ |
|
| 18 | public function __construct(bool $value = null, bool $allowSerializeEmpty = false) |
|
| 19 | { |
|
| 20 | $this->value = $value; |
|
| 21 | $this->allowSerializeEmpty = $allowSerializeEmpty; |
|
| 22 | } |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @return null |
|
| 26 | */ |
|
| 27 | public function serializeEmpty() |
|
| 28 | { |
|
| 29 | return; |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @return bool|null |
|
| 34 | */ |
|
| 35 | public function serialize() |
|
| 36 | { |
|
| 37 | return $this->value; |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| @@ 7-39 (lines=33) @@ | ||
| 4 | ||
| 5 | namespace Saxulum\ElasticSearchQueryBuilder\Node; |
|
| 6 | ||
| 7 | final class FloatNode extends AbstractNode |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @var float|null |
|
| 11 | */ |
|
| 12 | private $value; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @param float|null $value |
|
| 16 | * @param bool $allowSerializeEmpty |
|
| 17 | */ |
|
| 18 | public function __construct(float $value = null, bool $allowSerializeEmpty = false) |
|
| 19 | { |
|
| 20 | $this->value = $value; |
|
| 21 | $this->allowSerializeEmpty = $allowSerializeEmpty; |
|
| 22 | } |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @return null |
|
| 26 | */ |
|
| 27 | public function serializeEmpty() |
|
| 28 | { |
|
| 29 | return; |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @return float|null |
|
| 34 | */ |
|
| 35 | public function serialize() |
|
| 36 | { |
|
| 37 | return $this->value; |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| @@ 7-39 (lines=33) @@ | ||
| 4 | ||
| 5 | namespace Saxulum\ElasticSearchQueryBuilder\Node; |
|
| 6 | ||
| 7 | final class IntNode extends AbstractNode |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @var int|null |
|
| 11 | */ |
|
| 12 | private $value; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @param int|null $value |
|
| 16 | * @param bool $allowSerializeEmpty |
|
| 17 | */ |
|
| 18 | public function __construct(int $value = null, bool $allowSerializeEmpty = false) |
|
| 19 | { |
|
| 20 | $this->value = $value; |
|
| 21 | $this->allowSerializeEmpty = $allowSerializeEmpty; |
|
| 22 | } |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @return null |
|
| 26 | */ |
|
| 27 | public function serializeEmpty() |
|
| 28 | { |
|
| 29 | return; |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @return int|null |
|
| 34 | */ |
|
| 35 | public function serialize() |
|
| 36 | { |
|
| 37 | return $this->value; |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| @@ 7-39 (lines=33) @@ | ||
| 4 | ||
| 5 | namespace Saxulum\ElasticSearchQueryBuilder\Node; |
|
| 6 | ||
| 7 | final class StringNode extends AbstractNode |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @var string|null |
|
| 11 | */ |
|
| 12 | private $value; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @param string|null $value |
|
| 16 | * @param bool $allowSerializeEmpty |
|
| 17 | */ |
|
| 18 | public function __construct(string $value = null, bool $allowSerializeEmpty = false) |
|
| 19 | { |
|
| 20 | $this->value = $value; |
|
| 21 | $this->allowSerializeEmpty = $allowSerializeEmpty; |
|
| 22 | } |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @return null |
|
| 26 | */ |
|
| 27 | public function serializeEmpty() |
|
| 28 | { |
|
| 29 | return; |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @return string|null |
|
| 34 | */ |
|
| 35 | public function serialize() |
|
| 36 | { |
|
| 37 | return $this->value; |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||