This topic contains 0 replies, has 1 voice, and was last updated by golriz.nourani 8 years, 1 month ago.
- Topic
Hi Dears
I want to user some thing like contacts of account for my entity so I apply below migration:
123456789101112131415161718192021222324252627282930313233343536public function up(Schema $schema, QueryBag $queries ){self::centerTable($schema,$this->extendExtension);$center = $schema->getTable('websys_center');$contact = $schema->getTable('orocrm_contact');$targetTitleColumnNames = ["name_prefix", "first_name", "middle_name", "last_name", "name_suffix"];$targetDetailedColumnName = ["name_prefix", "first_name", "middle_name", "last_name", "name_suffix"];$targetGridColumnNames = ["email"];///table name oro_rel_475cee1283dfdfa4334015//index of default_contact in center FK_37B40600A56CA738$this->extendExtension->addManyToManyRelation($schema,$center, 'contacts',$contact, $targetTitleColumnNames, $targetDetailedColumnName, $targetGridColumnNames,['extend' =>['without_default' => false,'is_extend' => true,'owner' => ExtendScope::OWNER_CUSTOM]]);}but when I want to save a new instance of my entity I have this error:
Fatal error: Call to a member function add() on a non-object in ../public_html/vendor/oro/platform/src/Oro/Bundle/FormBundle/Form/EventListener/MultipleEntitySubscriber.php on line 82
my entity :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778/*** Center** @ORM\Table(name="websys_center")* @ORM\Entity* @ORM\HasLifecycleCallbacks()* @Oro\Loggable* @Config(* routeName="websys_center_index",* routeView="websys_center_view",* defaultValues={* "entity"={* "icon"="icon-tasks"* },* "ownership"={* "owner_type"="USER",* "owner_field_name"="owner",* "owner_column_name"="user_owner_id",* "organization_field_name"="organization",* "organization_column_name"="organization_id"* },* "security"={* "type"="ACL",* "group_name"=""* },* "dataaudit"={* "auditable"=true* },* "form"={* "form_type"="websys_center_select",* "grid_name"="center-grid",* }* }* )*/class Center extends ExtendCenter{/*** @var integer** @ORM\Column(name="id", type="integer")* @ORM\Id* @ORM\GeneratedValue(strategy="AUTO")* @ConfigField(* defaultValues={* "importexport"={* "identity"=true,* }* }* )*/private $id;/*** @var string** @ORM\Column(type="string", length=255)* @Oro\Versioned* @ConfigField(* defaultValues={* "merge"={* "display"=true* },* "dataaudit"={* "auditable"=true* },* "importexport"={* "identity"=true,* "order"=20* }* }* )*/private $name;//////....... other properties and getter and setter}could you help me?
I debug code and I see that FormBuilder can not build contacts of center form correctly.
regards,
Golriz
The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.