255], ]; } /* * Relations */ public function getDevelopmentPriority() { return $this->hasMany( DevelopmentPriority::className(), ['id_development' => 'id']) ->with('producer'); } public function getDevelopmentPriorityCurrentProducer() { return $this->hasOne( DevelopmentPriority::className(), ['id_development' => 'id']) ->where(['id_producer' => Producer::getId()]) ->with('producer'); } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'subject' => 'Sujet', 'description' => 'Description', 'date' => 'Date', 'progress' => 'Avancement', 'status' => 'Statut', 'time_estimate' => 'Estimation temps', 'type' => 'Type', 'date_delivery' => 'Date de livraison' ]; } /** * Retourne les options de base nécessaires à la fonction de recherche. * * @return array */ public static function defaultOptionsSearch() { return [ 'with' => ['developmentPriority', 'developmentPriorityCurrentProducer'], 'join_with' => [], 'orderby' => 'date DESC', 'attribute_id_producer' => '' ] ; } /** * Définit une date de livraison. * * @param string $date */ public function setDateDelivery($date = '') { if (strlen($date)) { $this->date_delivery = $date; } if (strlen($this->date_delivery)) { $this->date_delivery = date('Y-m-d', strtotime($this->date_delivery)); } } }