Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Relations
-
Labels:None
-
Environment:n/a
Description
Let's say I have following tables:
article
- art_id
article_version
- art_id
- art_version
category
- cat_id
category2article
- cat_id
- art_id
category2article_version
- cat_id
- art_id
- art_version
As I know I can describe relation between tables `article` and `category`, but I cannot describe relation between `artcile_version` and `category`.
The problem is Doctrine supports only following relation mapping:
$this->hasMany('Category as categories', array(
'local' => 'art_id',
'foreign' => 'cat_id',
'refClass' => 'Category2Article'
));
It would be nice to have also something like that:
$this->hasMany('Category as categories', array(
'local' => array('art_id', 'art_version')
'foreign' => 'cat_id',
'refClass' => 'Category2ArticleVc'
));
In the first (supported) example Doctrine produce something like that, when I add LEFT JOIN STATEMENT:
SELECT *
FROM article a
LEFT OUTER JOIN category2article c2a ON c2a.art_id = a.art_id
LEFT OUTER JOIN category c ON c.cat_id = c2a.cat_id
But I would like to have also support for following example:
SELECT *
FROM article_version a_vc
LEFT OUTER JOIN category2article_version c2a_vc ON c2a_vc.art_id = a_vc.art_id AND c2a_vc.art_version = a_vc.art_version
LEFT OUTER JOIN category c ON c.cat_id = c2a_vc.cat_id
–
Very best,
Tomasz Kuter
PS. I will check Doctrine code.. maybe I will solve it by myself..
Activity
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Roman S. Borschel [ romanb ] | Jonathan H. Wage [ jwage ] |
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-742, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)