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
{{ message }}
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
So I have to implement the __toString() method in the Bar and Qux classes and they must absolutely return an identifier (most likely the entity id), because I need it later in my custom Locator for example. That prevents me from using the __toString() method for a real representation as a string of the concerned entities.
IMO, in the DoctrineComponentDataResolver, if the getter of the field returns an object, it should try to load its metadata. If the object is an entity, it should return its identifier.
The text was updated successfully, but these errors were encountered:
I understand your issue.
Unfortunately, I guess we don't support components where primary key is a relation ...
If you find something to make it work, 👍
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have an entity that has a double primary / foreign key as identifier (like in a
ManyToMany
association) :I want to use it as a component :
The
DoctrineComponentDataResolver
class casts as string the value returned by thebar
andqux
properties getters to determine the identifier stored in theComponent
entity (https://github.com/stephpy/timeline-bundle/blob/master/ResolveComponent/DoctrineComponentDataResolver.php#L54). This identifier is also used to check if the component already exists or no.So I have to implement the
__toString()
method in theBar
andQux
classes and they must absolutely return an identifier (most likely the entity id), because I need it later in my customLocator
for example. That prevents me from using the__toString()
method for a real representation as a string of the concerned entities.IMO, in the
DoctrineComponentDataResolver
, if the getter of the field returns an object, it should try to load its metadata. If the object is an entity, it should return its identifier.The text was updated successfully, but these errors were encountered: