This is the Model, and I want get both user's data
class PersonalMessage extends BaseModel
{
public $fromUserId;
public $toUserId;
public function initialize()
{
$this->belongsTo('fromUserId', 'User', 'id', array('foreignKey' => true));
$this->belongsTo('toUserId', 'User', 'id', array('foreignKey' => true));
}
}
and I use this to get user
{{personalMessage.user.username}}
But I can only get the data which linked to toUserId
How can I get the other user?