I want the dynamic mapping of objects on one object to be used by other objects. For example, I have a File object that will store the type MIME, association key, nameetc., and also entity_idthat will contain an identifier for the object to which it belongs. The mapping keywill determine the class, since this file object will be many-to-many. Thus, the object targetEntityfor the file is not fixed. How to achieve this?
File entity
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
class File {
protected $entity;
}
Product
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
class Product extends SuperClass {
protected $files;
}
, Product, , getFiles() . , , , ?