cakephp 2 x join

Solutions on MaxInterview for cakephp 2 x join by the best coders in the world

showing results for - "cakephp 2 x join"
Pierce
20 Oct 2016
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