Re: How to name the fields when 2 fields in a table refers to same field in another table

2009-10-06 Thread vekija
in your service model set relation like this $belongsTo = array( 'ServiceProvider' => array( 'className' => 'User', 'foreignKey' => 'served_by' ), 'ServiceUser' => array( 'className' => 'User', 'foreignKey' => 'served_to', ) ); Then yopu can access

How to name the fields when 2 fields in a table refers to same field in another table

2009-10-06 Thread Jiru
Hi CakePHP programmers, plz help me.. We have two tables - users and services. services table needs to have two fields (served_by & served_to) - both referring to user_id. That case, what should be field names in services table because as per cakephp file naming conventions "foreign keys should