Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 2 replies, has 1 voice, and was last updated by adriwan_kenoby adriwan_kenoby 1 year, 6 months ago.

  • Creator
  • #17731

    Hi everybody,

    I have a problem with form.

    I added a relation between Account (OroCRMAccountBundle:Account) and a custom entity using migration ( because i wanted to have a bidirectionnal relationship )

    I want to added a field in my custom entityType to choose an account relied to my entity.

    I am aware that the probleme is I added the relation between custom entity and account using migration,

    then i havent the attribute $account in my class and then it cannot be shown in form. I assume that it was generated automaticaly. How can i manage it ?

    May i use common doctrine relation ? But then the relationship will no longer bidirectionnal …

    Moreover, I have notice some weird thing that i don’t understand in form :

    – in FormBuilderInterface::add() when i use entity type , i have to define data_class but if i forgot the first ‘\’, i have an error when i want to edit my entity. ( resolver wait for an object but he found boolean ?)

    – with OptionsResolverInterface::setDefault(), if i put the first ‘\’ to define data_class then i haven’t error but the ownership field diseapper. I don’t undestand why this make a difference…

    Here is my code but you can found it on gitlab :

    For the moment I think I will abandonned migration solution to a common unidirectionnal relationship, but if you have a solution, i am interesting.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #17733

    I was wrong, still the same problem using common unidirectionnal relation in my entity


    Sorry, i just forget to add the field in my view.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.