This topic contains 3 replies, has 2 voices, and was last updated by Yurii Muratov 9 years, 2 months ago.
- Topic
Hi Oro Friends!
Created a migration script here to set up a custom entity. I figured out how to set “labels” on the fields but how can I set the “entity label”?
This is my migration code:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108<?phpnamespace Acme\Bundle\TestBundle\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\EntityExtendBundle\EntityConfig\ExtendScope;use Oro\Bundle\MigrationBundle\Migration\Migration;use Oro\Bundle\MigrationBundle\Migration\QueryBag;class TestBundle implements Migration, ExtendExtensionAwareInterface{protected $extendExtension;public function setExtendExtension(ExtendExtension $extendExtension){$this->extendExtension = $extendExtension;}public function up(Schema $schema, QueryBag $queries){$table = $this->extendExtension->createCustomEntityTable($schema,'TestCustomEntity');$table->addColumn('first_name','string',['length' => 100,'oro_options' => ['entity' => ['label' => 'First Name','plural_label' => 'First Names','description' => 'First name',],'extend' => ['owner' => ExtendScope::OWNER_CUSTOM],]]);$table->addColumn('last_name','string',['length' => 100,'oro_options' => ['entity' => ['label' => 'Last Name','plural_label' => 'Last Names','description' => 'Last name',],'extend' => ['owner' => ExtendScope::OWNER_CUSTOM],]]);$table->addColumn('email','string',['length' => 255,'oro_options' => ['entity' => ['label' => 'Email','plural_label' => 'Emails','description' => 'Email',],'extend' => ['owner' => ExtendScope::OWNER_CUSTOM],]]);$table->addColumn('created_at','datetime',['oro_options' => ['entity' => ['label' => 'Created at','plural_label' => 'Created at','description' => 'Created at',],'extend' => ['owner' => ExtendScope::OWNER_CUSTOM],]]);$table->addColumn('updated_at','datetime',['oro_options' => ['entity' => ['label' => 'Updated at','plural_label' => 'Updated at','description' => 'Updated at',],'extend' => ['owner' => ExtendScope::OWNER_CUSTOM],]]);}}
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.