yii2-relation-trait icon indicating copy to clipboard operation
yii2-relation-trait copied to clipboard

ID column for Related model doesn't populate on Post

Open EdsonRCJ opened this issue 5 years ago • 0 comments

I'm using loadAll() function and works fine, but It doesn't populate the id for the related model

{ "id":"6", "idEscolaridade":"16", "descricao":"teste", "salario":5500.00, "Escolaridades":{ "id":"16", "descricao":"testando" } }

I'm using 'jaacoder/yii2-activated' to mapping the attributes, works for the parent model, but doesn't work for related models (ID column only)

My mapping function on "Escolaridades" model : `

public static function mapping(){
  return [
       'id' => 'esco_id',
      'descricao' => 'esco_descricao'
   ];

} `

EdsonRCJ avatar Oct 01 '20 16:10 EdsonRCJ