Go to Google Groups Home    doctrine-user
Using a join in query with no relation in schema

Chtipepere <chtipep...@gmail.com>

Hi everybody,
I'm quite new to Doctrine, and I'm trying that :

return Doctrine_Query::create()
 ->select('News.*, Car.*')
 ->from('News, Car')
 ->where('News.object = ? and Car.id = News.object_id', 'Car')
 ->execute();

schema.yml:
cars:
  name:  string

news:
  title:  string
  object:  string
  objec_id: string

In the schema, there's no relation between news and car, because I
want to use news for other object (like moto for exemple), and I'm not
that good to create a behavior.

Here's the error :
"Car" with an alias of "Car" in your query does not reference the
parent component it is related to.

If anyone can help... ?

thanks in advance to everyone.

πR