hasOne(Producer::class, ['id' => 'id_producer']); } /** * @inheritdoc */ public function attributeLabels() { return [ 'id_producer' => 'Producteur', 'id_development' => 'Développement', 'priority' => 'Priorité' ]; } /** * Retourne les options de base nécessaires à la fonction de recherche. * * @return array */ public static function getDefaultOptionsSearch() { 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 == DevelopmentPriorityModel::PRIORITY_LOW) { $styleButton = 'info'; } elseif ($this->priority == DevelopmentPriorityModel::PRIORITY_NORMAL) { $styleButton = 'warning'; } elseif ($this->priority == DevelopmentPriorityModel::PRIORITY_HIGH) { $styleButton = 'danger'; } return $styleButton; } }