Skip to content

Commit 528a59a

Browse files
committed
feat(select): expose options in FieldDefinition.jsonSerialize
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 38a76ee commit 528a59a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/Db/FieldDefinition.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ public function __construct() {
7676
* initial_visibility: string,
7777
* sort_order: int,
7878
* active: bool,
79+
* options: list<string>|null,
7980
* created_at: string,
8081
* updated_at: string,
8182
* }
8283
*/
8384
public function jsonSerialize(): array {
85+
$rawOptions = $this->getOptions();
86+
8487
return [
8588
'id' => $this->getId(),
8689
'field_key' => $this->getFieldKey(),
@@ -92,6 +95,7 @@ public function jsonSerialize(): array {
9295
'initial_visibility' => $this->getInitialVisibility(),
9396
'sort_order' => $this->getSortOrder(),
9497
'active' => $this->getActive(),
98+
'options' => $rawOptions !== null ? json_decode($rawOptions, true) : null,
9599
'created_at' => $this->getCreatedAt()->format(DATE_ATOM),
96100
'updated_at' => $this->getUpdatedAt()->format(DATE_ATOM),
97101
];

0 commit comments

Comments
 (0)