Friday, April 27, 2012

Re: Model

Your Consult model would use $belongsTo.

ex.

/**
 * belongsTo associations
 *
 * @var array
 */
public $belongsTo = array(
'Patient' => array(
'className' => 'Patient',
'foreignKey' => 'patient_id',
),
);// End $belongsTo

Good luck,
Sean


On Friday, April 27, 2012 5:33:06 AM UTC-4, alexkd wrote:
I have two tables 1)Patient2)Consulting. Consulting has foreign key
patient_id. But Patient would not have Consulting_id.
What relation should I use?
I have to ensure saving to Consulting table after each saving of
patient. i.e its essential to saving to Consulting table after the
saving Patient.
How to ensure this?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: