I work with Symfony2 and Doctrine and I have a question regarding entities.
In a performance worries, I'm wondering if it is possible to use an entity without going all the associations?
Currently, I have not found another way to create a model inheriting the class with associations and associations specify NULL in the class that inherits.
thank you in advance
OK, a little detail, it's for a API REST (JSON).
This is my class :
/**
* Offerequipment
*
* @ORM\Table(name="offer_equipment")
* @ORM\Entity(repositoryClass="Charlotte\OfferBundle\Repository\Offerequipment")
*/
class Offerequipment
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="Charlotte\OfferBundle\Entity\Offer")
* @ORM\JoinColumn(name="offer_id", referencedColumnName="id")
*/
private $offer;
/**
* @ORM\ManyToOne(targetEntity="Charlotte\ProductBundle\Entity\Equipment")
* @ORM\JoinColumn(name="equipment_id", referencedColumnName="id")
*/
private $equipment;
/**
* @VirtualProperty
*
* @return String
*/
public function getExample()
{
return $something;
}
and with QueryBuilder method, i can't get my virtual properties or getters.
Thanks for your help :)