|Related to : How to map doctrine entities|
|Force Doctrine to Load Associated Entities in JOIN|
If you want to avoid Lazy Loading (recommended for loops), Doctrine
suggest that you JOIN an entity at the time of the query. But you also
have to add the entity to the SELECT statement, e.g.
From the Doctrine Docs on Join
A SELECT query can contain joins. There are 2 types of JOINs:
“Regular” Joins and “Fetch” Joins.
|Can Doctrine Join itself|
To answer the specifically stated question, you can easily join any
entity to itself (even if it does not have a self-referential
association), simply by joining to the entity shortcut name (instead
of the associated field name like normal).
$queryBuilder = $viewVersionRepo->createQueryBuilder('e')
|Doctrine ORM Custom Column Collation|
This has been added by now if you (or someone else) still need, see
* @var string
* @ORMColumn(type="string", length=64, nullable=false,
This is supported by all common database drivers now.
|Doctrine one-to-many relation - "No identifier/primary key specified"|
I'd rather give you working example of OneToMany from one of my
projects, so you can see the difference and format code in proper way.
If it does not work, then try to get a new Symfony dist and start
use DoctrineORMMapping as ORM;
|Doctrine ORM linking foreign key to multiple tables|
You "resolve" this by accepting the fact that you will have multiple
tables "with similar structures".
The reason for which you have tables is not their structure, the
reason why you have tables is because of what they (and their
contents) mean to the end user.
So the decision about which number of tables to have, should be driven
first and foremost by what meaning they represent to the user, wi