And what would the DQL look like since, technically the product_id is mapped to two different objects, Feature and Foo? I simply want to run the following sql, but can't sort my way through the doctrine puzzle.
"SELECT * FROM Product p
INNER JOIN Feature f1 p.id=f1.product_id
INNER JOIN Foo f2 ON f1.product_id=p.foo_id"
- Code: Select all
/** @Entity **/
class Feature
{
/**
* @ManyToOne(targetEntity="Product", inversedBy="features")
* @JoinColumn(name="product_id", referencedColumnName="id")
* @OneToOne(targetEntity="Feature")
* @JoinColumn(referencedColumnName="foo_id")
**/
private $product;
// ...
}
/** @Entity **/
class Foo
{
/**
* @Column(name="foo_id")
**/
private $foo_id;
// ...
}
