Niranjan Acharya Tue Oct 04 10:25:53 -0400 2011

Subject: Associations, Joins and Data??

Hi all

I have a database with existing tables as per another application. the tables does not use the primary key and other conventions as used in phpactiverecord (primary key like id to point to a record in the table) instead I have primary keys e.g. "MyTable" -> MyTableid which cannot be used in phpactiverecord as automated id field. I have explicitly defined the primary_key for each class (table)

now I want to join two tables where tableA.nation_code = tableB.nat_code

I created the class for tableA and used the syntax:
tableA::all(array('joins' => array(tableB)));

now I get the data for only those records which have tableA.nation_code!

if a record does not have tableA.nation_code, it will not be displayed in the output.

please guide...