No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

OrderStatusHistory.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 OrderStatusHistory extends ActiveRecordCommon
  14. {
  15. /**
  16. * @inheritdoc
  17. */
  18. public static function tableName()
  19. {
  20. return 'order_status_history';
  21. }
  22. /**
  23. * @inheritdoc
  24. */
  25. public function rules()
  26. {
  27. return [
  28. [['id_order', 'status', 'id_user',], '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_user' => 'Utilisateur',
  41. 'status' => 'Statut',
  42. 'date' => 'Date',
  43. ];
  44. }
  45. /*
  46. * Relations
  47. */
  48. public function getOrder()
  49. {
  50. return $this->hasOne(User::className(), ['id' => 'id_order']);
  51. }
  52. public function getOrderStatus()
  53. {
  54. return $this->hasOne(OrderStatus::className(), ['id' => 'id_order_status']);
  55. }
  56. public function getUser()
  57. {
  58. return $this->hasOne(User::className(), ['id' => 'id_user']);
  59. }
  60. /**
  61. * Retourne les options de base nécessaires à la fonction de recherche.
  62. *
  63. * @return array
  64. */
  65. public static function defaultOptionsSearch()
  66. {
  67. return [
  68. 'with' => [],
  69. 'join_with' => ['order', 'orderStatus'],
  70. 'orderby' => 'date ASC',
  71. 'attribute_id_producer' => ''
  72. ];
  73. }
  74. }