hasOne(Etablissement::className(), ['id' => 'id_etablissement']); } /** * @inheritdoc */ public function attributeLabels() { return [ 'id_etablissement' => 'Établissement', 'id_developpement' => 'Développement', 'priorite' => 'Priorité' ]; } public function getStrPriorite() { switch ($this->priorite) { case self::PRIORITE_BASSE : return 'Basse'; break; case self::PRIORITE_NORMALE : return 'Normale'; break; case self::PRIORITE_HAUTE : return 'Haute'; break; default: return 'Non définie'; break; } } public function getClassCssStyleBouton() { $style_bouton = 'default'; if ($this->priorite == DeveloppementPriorite::PRIORITE_BASSE) $style_bouton = 'info'; elseif ($this->priorite == DeveloppementPriorite::PRIORITE_NORMALE) $style_bouton = 'warning'; elseif ($this->priorite == DeveloppementPriorite::PRIORITE_HAUTE) $style_bouton = 'danger'; return $style_bouton; } }