You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We want to use stringable object as id for entity instead of normal string
Motivation behind this is so you can be 100% sure everywhere with which entity ID you are working
And it works most cases but when you have these entities in OneHasMany or ManyHasMany relation (where you are making collection from them) it will cause error Cannot access offset of type EntityId on array when you are trying to get one from other
Describe the solution you'd like.
Create EntityId class which can be then extended and it will be ready everywhere for use in those relations
So it can be used in Entity for example like this: * @property-read EntityId $id {primary} {wrapper \App\Infrastructure\Shared\Nextras\Wrapper\IdWrapper}
Or indexes will have to be tested if its object so something like this: $index = \is_object(index) ? (string) $index : $index
Describe alternatives you've considered.
For now we're just using string as ID
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
stringable
object asid
for entity instead of normalstring
OneHasMany
orManyHasMany
relation (where you are making collection from them) it will cause errorCannot access offset of type EntityId on array
when you are trying to get one from otherDescribe the solution you'd like.
EntityId
class which can be then extended and it will be ready everywhere for use in those relationsEntityId
* @property-read EntityId $id {primary} {wrapper \App\Infrastructure\Shared\Nextras\Wrapper\IdWrapper}
$index = \is_object(index) ? (string) $index : $index
Describe alternatives you've considered.
The text was updated successfully, but these errors were encountered: