Join in model

hi I need select with join in model, example:

SELECT,, p.project_name
    user AS u
    JOIN project AS p ON p.user_id =

how do it without phql?

edited Mar '15

Hey man

You can use example below :

 * Returns users which doesn't belong to any organization.
 * @return mixed
public static function getUnassigned()
    $query = User::query()
        ->columns(__NAMESPACE__ . '\User.*')
        ->leftJoin(__NAMESPACE__ . '\OrganizationUser', __NAMESPACE__ . '\ = ou.idUser', 'ou')
        ->where('ou.idUser IS NULL')

    if ($query->count()) {
        return $query;

    return false;

Also you can refer to here