An entity that exists in your database is not a new entity so it does not have to be constructed. It should not matter if the domainobject you want to find in your repository is managed or must be fetched from a database first. Constructors are for new entities, not for persisted entities.
Op 10 nov. 2012 om 02:44 heeft fesja <fes...@gmail.com> het volgende geschreven:
> I'm starting with Doctrine2 (previously in Doctrine1.2) and I have found something that seems strange and I don't understand.
> I do a query to get a place:
> namespace TE\TestBundle\Entity;
> use Doctrine\ORM\EntityRepository;
> class PlaceRepository extends EntityRepository
> It returns me an object of that Entity, but it doesn't execute the __construct() method.
> Could you explain me why and how is the philosophy about that, and how I have to manage those kinds of things. On this scenario, I wanted to inject a service to Place through the constructor.
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.