hasOne(Producer::className(), ['id' => 'id_producer']); } /** * @inheritdoc */ public function attributeLabels() { return [ 'id_producer' => 'Producteur', 'id_producer' => 'Développement', 'priority' => 'Priorité' ]; } /** * Retourne les options de base nécessaires à la fonction de recherche. * * @return array */ public static function defaultOptionsSearch() { return [ 'with' => [], 'join_with' => [], 'orderby' => '', 'attribute_id_producer' => 'development_priority.id_producer' ] ; } /** * Retourne la priorité. * * @return string */ public function getStrPriority() { switch ($this->priority) { case self::PRIORITY_LOW : return 'Basse'; break; case self::PRIORITY_NORMAL : return 'Normale'; break; case self::PRIORITY_HIGH : return 'Haute'; break; default: return 'Non définie'; break; } } /** * Retourne la classe CSS du bouton servant à définir la priorité. * * @return string */ public function getClassCssStyleButton() { $styleButton = 'default'; if ($this->priority == DevelopmentPriority::PRIORITY_LOW) { $styleButton = 'info'; } elseif ($this->priority == DevelopmentPriority::PRIORITY_NORMAL) { $styleButton = 'warning'; } elseif ($this->priority == DevelopmentPriority::PRIORITY_HIGH) { $styleButton = 'danger'; } return $styleButton; } }