hey dschissler,
thanks for your answer anyway. i will describe it a litte bit more percise.
I have following code:
A Model User which has normal data like username, email,...
and 3 other relations.
class User extends Model
{
/** Initialize method for model.*/
public function initialize()
{
$this->setSource($this->tableName);
$this->hasMany('id', __NAMESPACE__ . '\UserRole', 'authuserentity_id', array('alias' => 'UserRoles', 'foreignKey' => array('action' => Relation::ACTION_CASCADE)));
$this->hasMany('id', __NAMESPACE__ . '\Option', 'user_id', array('alias' => 'Options', 'foreignKey' => array('action' => Relation::ACTION_CASCADE)));
$this->hasMany('id', __NAMESPACE__ . '\Protocol', 'user_id', array('alias' => 'Protocols', 'foreignKey' => array('action' => Relation::ACTION_CASCADE)));
}
....
so if i am using
$model = User::find();
foreach($model as $user){
$options = $user->getOptions();
}
i will receive the Options.
now i just wanna have the field for example id of the User Model and only the field value of the Option Model. but ther i dont know how to add the columns from the relations. I dont think i need to add a extra join because the relation is already defined!?
$model = User::find(array('columns'=>'id,?value?'));
thanks for your time.
pat