This topic contains 7 replies, has 2 voices, and was last updated by Yevhen Shyshkin 9 years, 6 months ago.
- Topic
Hello all,
I’m trying to implement a small app with OroPlatform and I have the following problem:
I have an entity ‘Person’ which is linked through a OneToMany relationship to an entity ‘SocialNetwork’, here are the annotations:1234567891011121314151617/*** @var Collection** @ORM\OneToMany(targetEntity="MyBundle\Bundle\ContactBundle\Entity\SocialNetwork", mappedBy="owner", cascade={"all"}, orphanRemoval=true)* @ORM\OrderBy({"socialNetworkName" = "DESC"})* @Soap\ComplexType("MyBundle\Bundle\ContactBundle\Entity\SocialNetwork[]", nillable=true)* @ConfigField(* defaultValues={* "importexport"={* "excluded"=true* }* }* )*/protected $socialNetworks;I tried to do the same as the Contact entity and Address entity of the OroCRM bundle but whenever I try to post a form to create a new entity Contact without filling the social network fields I have the following error:
123Argument 1 passed to ...\Person::addSocialNetwork() must be an instance of ...\SocialNetwork, null givenwhereas it’s not a problem to leave the address fields empty in OroCRM while creating a new contact.
In a “classical” bundle I would normally set the default argument of addSocialNetwork to null but it doesn’t work (and it’s not used in OroCRM).
Am I missing something ?
The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.