LogEvent.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Chamilo\PluginBundle\Entity\WhispeakAuth;
  4. use Chamilo\UserBundle\Entity\User;
  5. use DateTime;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * Class LogEvent.
  9. *
  10. * @package Chamilo\PluginBundle\Entity\WhispeakAuth
  11. *
  12. * @ORM\Table(name="whispeak_log_event")
  13. * @ORM\Entity()
  14. * @ORM\InheritanceType("SINGLE_TABLE")
  15. * @ORM\DiscriminatorColumn(name="discr", type="string")
  16. * @ORM\DiscriminatorMap({
  17. * "log_event" = "Chamilo\PluginBundle\Entity\WhispeakAuth\LogEvent",
  18. * "log_event_lp" = "Chamilo\PluginBundle\Entity\WhispeakAuth\LogEventLp",
  19. * "log_event_quiz" = "Chamilo\PluginBundle\Entity\WhispeakAuth\LogEventQuiz"
  20. * })
  21. */
  22. class LogEvent
  23. {
  24. const STATUS_FAILED = 0;
  25. const STATUS_SUCCESS = 1;
  26. /**
  27. * @var int
  28. *
  29. * @ORM\Column(name="id", type="integer")
  30. * @ORM\Id()
  31. * @ORM\GeneratedValue()
  32. */
  33. private $id;
  34. /**
  35. * @var DateTime
  36. *
  37. * @ORM\Column(name="datetime", type="datetime")
  38. */
  39. private $datetime;
  40. /**
  41. * @var int
  42. *
  43. * @ORM\Column(name="action_status", type="smallint")
  44. */
  45. private $actionStatus;
  46. /**
  47. * @var User
  48. *
  49. * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
  50. * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
  51. */
  52. private $user;
  53. /**
  54. * @return int
  55. */
  56. public function getId()
  57. {
  58. return $this->id;
  59. }
  60. /**
  61. * @param int $id
  62. *
  63. * @return LogEvent
  64. */
  65. public function setId($id)
  66. {
  67. $this->id = $id;
  68. return $this;
  69. }
  70. /**
  71. * @return DateTime
  72. */
  73. public function getDatetime()
  74. {
  75. return $this->datetime;
  76. }
  77. /**
  78. * @param DateTime $datetime
  79. *
  80. * @return LogEvent
  81. */
  82. public function setDatetime($datetime)
  83. {
  84. $this->datetime = $datetime;
  85. return $this;
  86. }
  87. /**
  88. * @return int
  89. */
  90. public function getActionStatus()
  91. {
  92. return $this->actionStatus;
  93. }
  94. /**
  95. * @param int $actionStatus
  96. *
  97. * @return LogEvent
  98. */
  99. public function setActionStatus($actionStatus)
  100. {
  101. $this->actionStatus = $actionStatus;
  102. return $this;
  103. }
  104. /**
  105. * @return User
  106. */
  107. public function getUser()
  108. {
  109. return $this->user;
  110. }
  111. /**
  112. * @param User $user
  113. *
  114. * @return LogEvent
  115. */
  116. public function setUser($user)
  117. {
  118. $this->user = $user;
  119. return $this;
  120. }
  121. }