cake php 2 x joins

Solutions on MaxInterview for cake php 2 x joins by the best coders in the world

showing results for - "cake php 2 x joins"
Matteo
15 Nov 2019
1$this->Message->find('all', array(
2    'joins' => array(
3        array(
4            'table' => 'users',
5            'alias' => 'UserJoin',
6            'type' => 'INNER',
7            'conditions' => array(
8                'UserJoin.id = Message.from'
9            )
10        )
11    ),
12    'conditions' => array(
13        'Message.to' => 4
14    ),
15    'fields' => array('UserJoin.*', 'Message.*'),
16    'order' => 'Message.datetime DESC'
17));
18