bindmodel cakephp

Solutions on MaxInterview for bindmodel cakephp by the best coders in the world

showing results for - "bindmodel cakephp"
Mirko
21 Sep 2018
1
2// Our case:
3MemberNotification -> BelongsTo -> Notification, 
4Notification -> HasMany -> NotificationLanguage
5
6$this->MemberNotification->recursive = 0;
7$this->set('memberNotifications', $this->paginate());
8$this->MemberNotification->bindModel(array(
9    'belongsTo' => array(
10        'NotificationLanguage' => array(
11            'foreignKey' => false,
12            'conditions' => array('Notification.id = NotificationLanguage.notification_id')
13        ),
14    )
15));
16
17// our purpose just make the NotificationLanguage same level with the Notification, 
18// so we can sort 2nd level association
19
20  
21
queries leading to this page
bindmodel cakephpbindmodel cakephp