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.

78 lines
1.5KB

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