Replies: 1 comment
-
Such a thing is not possible sadly enough because we cannot know what exactly is being passed:
Should this be constructed as: SomeData::fromMultiple('a', 'b')
// or
[
SomeData::from('a'),
SomeData::from('b'),
] What I mostly do: new DataCollection(SomeData::class, array_map(
fn(array $param) => SomeData::from(...$param),
[['a', 'b']]
)) |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Since we can make our own magical creation method in Data class:
Then how can we tell the DataCollection to use that creation method in code?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions