Hi all, I have model
class Event
extends Model
{
public $id;
public $created_at;
public $user_id;
public $type_id;
public $product_id;
public function initialize()
{
$this->hasOne('product_id', 'Product\\Model\Product', 'id', array(
'foreignKey' => true,
'alias' => 'Product'
));
$this->hasOne('user_id', 'User\\Model\User', 'id', array(
'foreignKey' => true,
'alias' => 'User'
));
$this->hasOne('type_id', 'User\\Model\Events\Type', 'id', array(
'foreignKey' => true,
'alias' => 'Type'
));
$this->hasMany('user_id', 'User\\Model\Follow\User', 'author_user_id', array(
'foreignKey' => true,
'alias' => 'Followers'
));
}
/**
* Independent Column Mapping.
*/
public function columnMap() {
return array(
'id' => 'id',
'created_at' => 'created_at',
'user_id' => 'user_id',
'type_id' => 'type_id',
'product_id' => 'product_id'
);
}
}
How can i left join on alias when use method >leftJoin or what i should use? Thanks for your help!