I'm new with Lithium
.I need to do a left join.This is the query
I need.
SELECT `title`,`body`,`user_id`,`users`.`username`,`users`.`id`
FROM `posts` LEFT JOIN `users`
ON `user_id` = `users`.`id`
I try to do something like this.
$conditions['user_id'] = $this->data['user_id'];
$posts = Post::all(array(
'conditions' => $conditions,
'fields' => array('title','body','username'),
'join' => array('source' => 'posts',
'type' => 'LEFT',
'constraint' => array('post.user_id' => 'Users.id')),
))->data();