Log.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\models\entity;
  3. /**
  4. * This is the model class for table "device_transaction_log".
  5. *
  6. * @property int $id
  7. * @property int $employee
  8. * @property int $tmc
  9. * @property string $issue_date
  10. * @property string $receipt_date
  11. * @property string $note
  12. */
  13. class Log extends \yii\db\ActiveRecord
  14. {
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public static function tableName()
  19. {
  20. return 'device_transaction_log';
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function rules()
  26. {
  27. return [
  28. [['employee', 'tmc'], 'required'],
  29. [['employee', 'tmc'], 'integer'],
  30. // [['employee', 'tmc'], 'safe'],
  31. [['issue_date', 'receipt_date'], 'string', 'max' => 255],
  32. ];
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function attributeLabels()
  38. {
  39. return [
  40. 'id' => 'ID',
  41. 'employee' => 'Employee ID',
  42. 'tmc' => 'TMC ID',
  43. 'issue_date' => 'Date of Issue',
  44. 'receipt_date' => 'Date of receipt',
  45. ];
  46. }
  47. /**
  48. * @return \yii\db\ActiveQuery
  49. */
  50. public function getEmployee()
  51. {
  52. return $this->hasOne(Accounts::class, ['id' => 'employee']);
  53. }
  54. /**
  55. * @return \yii\db\ActiveQuery
  56. */
  57. public function getTmc()
  58. {
  59. return $this->hasOne(Tmc::class, ['id' => 'tmc']);
  60. }
  61. }