Hi guys,
following method will give me back exactly one attribut called nachname from table. How do I have to change method in order to get two attributes,for instance surname and firstname
public static function nachname_for_ekontakt() {
$nachname = Person::find()
->innerJoin('e_kontakt', 'person.id=e_kontakt.id_person')
->orderBy(['nachname' => SORT_ASC])->asArray()->all();
return yii\helpers\ArrayHelper::map($nachname, 'id', 'nachname');
}
Mergings Array won’t help, as few as this
public static function nachname_for_ekontakt() {
$nachname = Person::find()
->innerJoin('e_kontakt', 'person.id=e_kontakt.id_person')
->orderBy(['nachname' => SORT_ASC])->asArray()->all();
return yii\helpers\ArrayHelper::map($nachname, 'vorname', 'nachname');
}