public function getAttrs()
{
return $this
->hasMany(Profile::className(), ['user_id' => 'id'])
->where('name = "name"')->union(
$this->hasMany(Profile::className(), ['user_id' => 'id'])->where('name = "surname"')
);
}
return $this->hasMany(User::className(), ['id' => 'u_id1'])
->viaTable('UserContacts', ['id' => 'u_id1'])->union($this->hasMany(User::className(), ['id' => 'u_id2'])
->viaTable('UserContacts', ['id' => 'u_id2']));