Replies: 1 comment
-
You can use both of them: class ItemData extends Data
{
#[RecordTypeScriptType('string', SizeData::class)]
/** @var DataCollection<string, SizeData> */
public array $sizes;
} Not the most beautiful but the best solution I'm afraid. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I currently have a Data object like the following.
I would like to transform it to a typescript type like below.
However, it gets transformed to
Array<SizeData>
instead. The only method I've found to transform it to aRecord
is to change my PHP type to an array and use theRecordTypeScriptType
.With this approach I lose the features of a
DataCollection
.Does anyone have suggestions on how I can use a
DataCollection
in my PHP object and also transform it to a TypeScriptRecord
?Beta Was this translation helpful? Give feedback.
All reactions