upgrade
This commit is contained in:
145
plugin/whispeakauth/Entity/LogEvent.php
Normal file
145
plugin/whispeakauth/Entity/LogEvent.php
Normal file
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
namespace Chamilo\PluginBundle\Entity\WhispeakAuth;
|
||||
|
||||
use Chamilo\UserBundle\Entity\User;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Class LogEvent.
|
||||
*
|
||||
* @package Chamilo\PluginBundle\Entity\WhispeakAuth
|
||||
*
|
||||
* @ORM\Table(name="whispeak_log_event")
|
||||
* @ORM\Entity()
|
||||
* @ORM\InheritanceType("SINGLE_TABLE")
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({
|
||||
* "log_event" = "Chamilo\PluginBundle\Entity\WhispeakAuth\LogEvent",
|
||||
* "log_event_lp" = "Chamilo\PluginBundle\Entity\WhispeakAuth\LogEventLp",
|
||||
* "log_event_quiz" = "Chamilo\PluginBundle\Entity\WhispeakAuth\LogEventQuiz"
|
||||
* })
|
||||
*/
|
||||
class LogEvent
|
||||
{
|
||||
public const STATUS_FAILED = 0;
|
||||
public const STATUS_SUCCESS = 1;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id()
|
||||
* @ORM\GeneratedValue()
|
||||
*/
|
||||
private $id;
|
||||
/**
|
||||
* @var DateTime
|
||||
*
|
||||
* @ORM\Column(name="datetime", type="datetime")
|
||||
*/
|
||||
private $datetime;
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="action_status", type="smallint")
|
||||
*/
|
||||
private $actionStatus;
|
||||
/**
|
||||
* @var User
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return LogEvent
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getDatetime()
|
||||
{
|
||||
return $this->datetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTime $datetime
|
||||
*
|
||||
* @return LogEvent
|
||||
*/
|
||||
public function setDatetime($datetime)
|
||||
{
|
||||
$this->datetime = $datetime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getActionStatus()
|
||||
{
|
||||
return $this->actionStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $actionStatus
|
||||
*
|
||||
* @return LogEvent
|
||||
*/
|
||||
public function setActionStatus($actionStatus)
|
||||
{
|
||||
$this->actionStatus = $actionStatus;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return LogEvent
|
||||
*/
|
||||
public function setUser($user)
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTypeString()
|
||||
{
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
84
plugin/whispeakauth/Entity/LogEventLp.php
Normal file
84
plugin/whispeakauth/Entity/LogEventLp.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
namespace Chamilo\PluginBundle\Entity\WhispeakAuth;
|
||||
|
||||
use Chamilo\CourseBundle\Entity\CLp;
|
||||
use Chamilo\CourseBundle\Entity\CLpItem;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Class LogEventLp.
|
||||
*
|
||||
* @package Chamilo\PluginBundle\Entity\WhispeakAuth
|
||||
*
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class LogEventLp extends LogEvent
|
||||
{
|
||||
/**
|
||||
* @var CLpItem
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CLpItem")
|
||||
* @ORM\JoinColumn(name="lp_item_id", referencedColumnName="iid")
|
||||
*/
|
||||
private $lpItem;
|
||||
/**
|
||||
* @var CLp
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CLp")
|
||||
* @ORM\JoinColumn(name="lp_id", referencedColumnName="iid")
|
||||
*/
|
||||
private $lp;
|
||||
|
||||
/**
|
||||
* @return CLpItem
|
||||
*/
|
||||
public function getLpItem()
|
||||
{
|
||||
return $this->lpItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CLpItem $lpItem
|
||||
*
|
||||
* @return LogEventLp
|
||||
*/
|
||||
public function setLpItem($lpItem)
|
||||
{
|
||||
$this->lpItem = $lpItem;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CLp
|
||||
*/
|
||||
public function getLp()
|
||||
{
|
||||
return $this->lp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CLp $lp
|
||||
*
|
||||
* @return LogEventLp
|
||||
*/
|
||||
public function setLp($lp)
|
||||
{
|
||||
$this->lp = $lp;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getTypeString()
|
||||
{
|
||||
$lpName = $this->lp->getName();
|
||||
$itemTitle = $this->getLpItem()->getTitle();
|
||||
|
||||
return "$lpName > $itemTitle";
|
||||
}
|
||||
}
|
||||
84
plugin/whispeakauth/Entity/LogEventQuiz.php
Normal file
84
plugin/whispeakauth/Entity/LogEventQuiz.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/* For licensing terms, see /license.txt */
|
||||
|
||||
namespace Chamilo\PluginBundle\Entity\WhispeakAuth;
|
||||
|
||||
use Chamilo\CourseBundle\Entity\CQuiz;
|
||||
use Chamilo\CourseBundle\Entity\CQuizQuestion;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Class LogEventQuiz.
|
||||
*
|
||||
* @package Chamilo\PluginBundle\Entity\WhispeakAuth
|
||||
*
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class LogEventQuiz extends LogEvent
|
||||
{
|
||||
/**
|
||||
* @var CQuizQuestion
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CQuizQuestion")
|
||||
* @ORM\JoinColumn(name="question_id", referencedColumnName="iid")
|
||||
*/
|
||||
private $question;
|
||||
/**
|
||||
* @var CQuiz
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CQuiz")
|
||||
* @ORM\JoinColumn(name="quiz_id", referencedColumnName="iid")
|
||||
*/
|
||||
private $quiz;
|
||||
|
||||
/**
|
||||
* @return CQuizQuestion
|
||||
*/
|
||||
public function getQuestion()
|
||||
{
|
||||
return $this->question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CQuizQuestion $question
|
||||
*
|
||||
* @return LogEventQuiz
|
||||
*/
|
||||
public function setQuestion($question)
|
||||
{
|
||||
$this->question = $question;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CQuiz
|
||||
*/
|
||||
public function getQuiz()
|
||||
{
|
||||
return $this->quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CQuiz $quiz
|
||||
*
|
||||
* @return LogEventQuiz
|
||||
*/
|
||||
public function setQuiz($quiz)
|
||||
{
|
||||
$this->quiz = $quiz;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getTypeString()
|
||||
{
|
||||
$quiz = strip_tags($this->getQuiz()->getTitle());
|
||||
$question = strip_tags($this->getQuestion()->getQuestion());
|
||||
|
||||
return "$quiz > $question";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user