This topic contains 2 replies, has 2 voices, and was last updated by Guillaume Deneux 5 years, 12 months ago.
- Topic
I wish I could make a custom entity expandable by the cache system.
Example: Oro \ Bundle \ UserBundle \ Entity \ User and Oro \ Bundle \ UserBundle \ Model \ ExtendUser.
The goal is that the cache automatically generates the methods of the new attributes. These new attributes are created by migration scripts.12345678910111213141516171819202122232425class TbdPipelinerBundle implements Migration, ExtendExtensionAwareInterface{/** @var ExtendExtension */private $extendExtension;public function setExtendExtension(ExtendExtension $extendExtension){$this->extendExtension = $extendExtension;}public function up(Schema $schema, QueryBag $queries){foreach (['tbd_gitlab_project'] as $tableName){$this->extendExtension->addManyToOneRelation($schema,$schema->getTable($tableName), // owning side table'customer', // owning side field name'tbd_customer', // inverse side table'id', // column name is used to show related entity['extend' => ['owner' => ExtendScope::OWNER_CUSTOM,'nullable' => true, 'is_extend' => true],]);}}12345namespace Tbd\GitlabBundle\Entity;use Tbd\GitlabBundle\Model\ExtendProject;class Project extends ExtendProject{123namespace Tbd\GitlabBundle\Model;class ExtendProjectCurrently, it adds the column with the foreign key to the target table but it does not generate a cached class from my entity: tbd_gitlab_project ( and in a second time with method setter getter setCustomer() getCustomer() ) like the entity user :
app/cache/dev/oro_entities/Extend/Entity/EX_OroUserBundle_User.orm.yml
app/cache/dev/oro_entities/Extend/Entity/EX_OroUserBundle_User.php
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.