Hi,

I'm using the ahDoctrineEasyEmbeddedRelationsPlugin with a many to
many relation and I have an error :


500 | Internal Server Error | Doctrine_Record_Exception
Couldn't call Doctrine_Core::set(), second argument should be an
instance of Doctrine_Collection when setting many-to-many references.

Yaml :

Event:
  actAs: { Timestampable: ~ }
  columns:
 ...
  relations:
    ...
    Participant:
      class: Profile
      local: event_id
      foreign: profile_id
      refClass: EventProfile

Profile:
  actAs: { Timestampable: ~ }
  columns:
  ...
  relations:
     ...
    Event:
      class: Event
      local: profile_id
      foreign: event_id
      refClass: EventProfile

EventProfile:
  columns:
    profile_id:
      type: integer
    event_id:
      type: integer
  relations:
    Profiles:
      class: Profile
      local: profile_id
      foreign: id
      onDelete: CASCADE
    Event:
      class: Event
      local: event_id
      foreign: id
      onDelete: CASCADE

Here is my code :

class EventForm extends BaseEventForm {
    public function configure() {

        ...

        $this->embedRelations(array(
                'Participant' => array(
                        'considerNewFormEmptyFields'    => array(),
                        'noNewForm'                     => false,
                        'newFormLabel'                  => 'New
Adresse :',
                        'newFormClassArgs'              =>
array(array('sf_user' => $this->getOption('sf_user'))),
                        'displayEmptyRelations'         => false,
                        'formClassArgs'                 =>
array(array('ah_add_delete_checkbox' => false)),
                        'newFormAfterExistingRelations' => true,
                        'formFormatter'                 => null,
                        'multipleNewForms'              => true,
                        'newFormsInitialCount'          => 2,
                        'newFormsContainerForm'         => null,
                        'newRelationButtonLabel'        => '+',
                        'newRelationAddByCloning'       => true,
                        'newRelationUseJSFramework'     => 'jQuery',
                )
         )
 );

Can you help me please?

Thanks for your Help

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to