hasOne(Etablissement::className(), ['id'=>'id_etablissement']) ; } /** * @inheritdoc */ public function rules() { return [ [['date'], 'required'], [['date'], 'safe'], [['actif'], 'integer'] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'date' => 'Date', 'actif' => 'Actif', ]; } public function getCommande() { return $this->hasMany(Commande::className(), ['id_production' => 'id']) ; } }