0

Great site this is! A lot of good programmers. But I can't even get a simple doctrine join to work:

$query = Doctrine_Query::create()
        ->from("StaffIndividualHasAddressAddress sa")
        ->innerJoin("sa.AddressAddress aa");

Always bums out with:

Message: Unknown relation alias AddressAddress

Is my 'aliassing' not ok? My yaml seems perfectly fine...

And if there is nothing wrong with the query, what else could mess up the process?

Donatas Olsevičius
  • 1,350
  • 8
  • 13
jasper
  • 3
  • 4

1 Answers1

0

you may need to specify the join attribute.

  $query = Doctrine_Query::create()
        ->from("StaffIndividualHasAddressAddress sa")
        ->innerJoin("sa.AddressAddress aa WITH aa.AdressAdress != ? ",$where);
dori naji
  • 980
  • 1
  • 16
  • 41
  • Not working either. But I think i have an idea of whats going wrong here. I didn't mention that StaffIndividualHasAddressAddress and AddressAddress are located in two different modules, having two different yaml files that doctrine uses to map. Is this a probable explenation? Sorry if i waisted your time by not giving enough info. – jasper Jun 12 '12 at 14:14
  • did you integrate doctrine in a modular fashsion? and when you say StaffIndividualHasAddressAddress and AdressAdrees you mean each one of those is a table ? b – dori naji Jun 12 '12 at 18:16
  • it's an existing program i'm working on. it's modular, but if doctrine is integrated in a modular fashion, i don't know. StaffIndividualHasAddressAddress and AddresAddress are classes that extend their Base_ class (which in turn extends Doctrine_record). so, i guess, it is using the doctrine object rather than the table. I still don't get that much about doctrine and its workings behind the scenes. – jasper Jun 13 '12 at 06:56