0

Will the given below code can work where Mark and Subject are two model with which Student model associate through hasMany association

class Student extends AppModel
{
    public $name = 'Student';
    var $hasMany = array(
        'Mark' => array(
            'className' => 'Mark',
            'foreignKey' => 'student_id'
        ),
        'Subject' => array(
            'className' => 'Subject',
            'foreignKey' => 'student_id'
        )
    );
}

1 Answer 1

1

yes you can relationship with many tables

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

Find conditions with hasMany model

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.