hasOne(Product::className(), ['id' => 'id_product']); } /** * @inheritdoc */ public function rules() { return [ [['id_order', 'id_product', 'quantity'], 'required'], [['id_order', 'id_product'], 'integer'], [['unit'], 'string', 'max' => 255], [['quantity'], 'number', 'min' => 0] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'id_order' => 'Commande', 'id_product' => 'Product', 'quantity' => 'Quantité', 'unit' => 'Unité' ]; } /** * 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' => '' ] ; } }