Log.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Customer\Model;
  7. /**
  8. * Customer log model.
  9. *
  10. * Contains customer log data.
  11. */
  12. class Log
  13. {
  14. /**
  15. * Customer ID.
  16. *
  17. * @var int
  18. */
  19. protected $customerId;
  20. /**
  21. * Date and time of customer's last login.
  22. *
  23. * @var string
  24. */
  25. protected $lastLoginAt;
  26. /**
  27. * Date and time of customer's last logout.
  28. *
  29. * @var string
  30. */
  31. protected $lastVisitAt;
  32. /**
  33. * Date and time of customer's last visit.
  34. *
  35. * @var string
  36. */
  37. protected $lastLogoutAt;
  38. /**
  39. * @param int $customerId
  40. * @param string $lastLoginAt
  41. * @param string $lastVisitAt
  42. * @param string $lastLogoutAt
  43. */
  44. public function __construct($customerId = null, $lastLoginAt = null, $lastVisitAt = null, $lastLogoutAt = null)
  45. {
  46. $this->customerId = $customerId;
  47. $this->lastLoginAt = $lastLoginAt;
  48. $this->lastVisitAt = $lastVisitAt;
  49. $this->lastLogoutAt = $lastLogoutAt;
  50. }
  51. /**
  52. * Retrieve customer id
  53. *
  54. * @return int
  55. */
  56. public function getCustomerId()
  57. {
  58. return $this->customerId;
  59. }
  60. /**
  61. * Retrieve last login date as string
  62. *
  63. * @return string
  64. */
  65. public function getLastLoginAt()
  66. {
  67. return $this->lastLoginAt;
  68. }
  69. /**
  70. * Retrieve last visit date as string
  71. *
  72. * @return string
  73. */
  74. public function getLastVisitAt()
  75. {
  76. return $this->lastVisitAt;
  77. }
  78. /**
  79. * Retrieve last logout date as string
  80. *
  81. * @return string
  82. */
  83. public function getLastLogoutAt()
  84. {
  85. return $this->lastLogoutAt;
  86. }
  87. }