relationOrders('id_delivery_note') ; } /** * Retourne les options de base nécessaires à la fonction de recherche. * * @return array */ public static function defaultOptionsSearch() { return [ 'with' => [], 'join_with' => ['user AS user_delivery_note', 'orders', 'producer'], 'orderby' => 'date ASC', 'attribute_id_producer' => 'delivery_note.id_producer' ]; } public function isInvoiced() { if($this->orders && count($this->orders) > 0) { foreach($this->orders as $order) { if($order->id_invoice) { return true; } } } return false; } }