Thursday, 15 July 2010

cakephp 2.3 defining data model -



cakephp 2.3 defining data model -

in info model main entities openings (job), companies , students

the company creates opening have belongsto relationship fine

a pupil can apply many openings store have link table openings_students

id|opening_id|user_id

in opening model class have habtm association

public $hasandbelongstomany = array( 'applicants' => array( 'classname' => 'student', 'jointable' => 'openings_students', 'foreignkey' => 'opening_id', 'associationforeignkey' => 'user_id', 'unique' => 'true', 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'finderquery' => '', 'deletequery' => '', 'insertquery' => '' ) );

is need or need habtm relationship on student?

only getting started framework help appreciated.

the best document go threw cakephp 2.0

http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasandbelongstomany-habtm

i have question here using students table , foreign key user_id, having 2 tables users, students or single table students foreign key user_id ? can clarify that.

cakephp-2.3

No comments:

Post a Comment