find (Liste) gibt mehrere leere Optionen zurück, find (alle) gibt korrekte Daten zurück, die jedoch mit {@ formatiert sin

AvadiariesTable.php

$this->belongsTo('AlumnesGrups', [
        'foreignKey' => 'alumnes_grup_id',
        'joinType' => 'INNER'

AlumnesGrupsTable.php

$this->belongsTo('Alumnes', [
        'foreignKey' => 'alumne_id',
        'joinType' => 'INNER'
    ]);
    $this->belongsTo('Grups', [
        'foreignKey' => 'grup_id',
        'joinType' => 'INNER'
    ]);

Warum ist das in AvadiariesController.php:

 public function add()
    {
    $avadiary = $this->Avadiaries->newEntity();
        if ($this->request->is('post')) {
            $avadiary = $this->Avadiaries->patchEntity($avadiary, $this->request->data);
            $avadiary->user_id = $this->Auth->user('id');
            if ($this->Avadiaries->save($avadiary)) {
                $this->Flash->success(__('The avadiary has been saved.'));

                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error(__('The avadiary could not be saved. Please, try again.'));
            }
        }
    $alumnesGrups = $this->Avadiaries->AlumnesGrups->find('all', [
    'fields' => ['Alumnes.name'], 
    'contain' =>['Alumnes', 'Grups'], 
    'conditions' => ['Grups.id =' => 1], 
    'order' => ['Alumnes.name' => 'ASC']
    ]);
$this->set(compact('avadiary', 'alumnesGrups'));
        $this->set('_serialize', ['avadiary']);
    }

korrekte Daten zurückgeben, aber wie folgt formatiert:

{"Alumnes": {"name": "Angela Smith"}}?

Wie kann ich nur Angela Smith bekommen? Wenn ich find (all) in find (list) ändere, enthält das Auswahlfeld mehrere leere Optionen.

Vielen Dank

Antworten auf die Frage(2)

Ihre Antwort auf die Frage