This topic contains 3 replies, has 3 voices, and was last updated by klipach 9 years, 3 months ago.
- Topic
I need to create a new entity6 called specialization, with functionality similar to groups. Here is my migration code
<?php
namespace Acme\ContactBundle\Migrations\Schema\v1_0;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtension;
use Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtensionAwareInterface;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
use Oro\Bundle\EntityExtendBundle\EntityConfig\ExtendScope;12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152class AcmeContactBundle implements Migration, ExtendExtensionAwareInterface{/** @var ExtendExtension */protected $extendExtension;public function setExtendExtension(ExtendExtension $extendExtension){$this->extendExtension = $extendExtension;}public function up(Schema $schema, QueryBag $queries){$table = $this->extendExtension->createCustomEntityTable($schema,'Specialization');$table->addColumn('name','string',['length' => 100,'oro_options' => ['extend' => ['owner' => ExtendScope::OWNER_CUSTOM],'datagrid' => ['is_visible' => true],'merge' => ['display' => true],]]);$table->setPrimaryKey(['id']);$table->addUniqueIndex(['name']);$this->extendExtension->addManyToManyRelation($schema,$schema->getTable('orocrm_contact'),'specializations',$table,['name'],['name'],['name'],['extend' => ['without_default' => true,'is_extend' => true,'owner' => ExtendScope::OWNER_CUSTOM]]);}}but after migration i get
12[ReflectionException]Property OroCRM\Bundle\ContactBundle\Entity\Contact::$specializations does not existthe same result i have when i create table via migrations and try match it to an entity via GUI.
Can someone help me?
The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.