You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.5KB

  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "order_order_status".
  6. *
  7. * @property integer $id
  8. * @property integer $id_order
  9. * @property integer $id_order_status
  10. * @property string $date
  11. */
  12. class OrderOrderStatus extends \yii\db\ActiveRecord
  13. {
  14. /**
  15. * @inheritdoc
  16. */
  17. public static function tableName()
  18. {
  19. return 'order_order_status';
  20. }
  21. /**
  22. * @inheritdoc
  23. */
  24. public function rules()
  25. {
  26. return [
  27. [['id_order', 'id_order_status'], 'integer'],
  28. [['date'], 'safe'],
  29. ];
  30. }
  31. /**
  32. * @inheritdoc
  33. */
  34. public function attributeLabels()
  35. {
  36. return [
  37. 'id' => 'ID',
  38. 'id_order' => 'Commande',
  39. 'id_order_status' => 'Statut',
  40. 'date' => 'Date',
  41. ];
  42. }
  43. /*
  44. * Relations
  45. */
  46. public function getOrder()
  47. {
  48. return $this->hasOne(User::className(), ['id' => 'id_order']);
  49. }
  50. public function getOrderStatus()
  51. {
  52. return $this->hasOne(OrderStatus::className(), ['id' => 'id_order_status']);
  53. }
  54. /**
  55. * Retourne les options de base nécessaires à la fonction de recherche.
  56. *
  57. * @return array
  58. */
  59. public static function defaultOptionsSearch() {
  60. return [
  61. 'with' => [],
  62. 'join_with' => ['order', 'orderStatus'],
  63. 'orderby' => 'date ASC',
  64. 'attribute_id_producer' => ''
  65. ] ;
  66. }
  67. }