Completed
Push — master ( 506c79...7daaad )
by Julito
12:09
created

LogEventQuiz::setQuestion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\PluginBundle\Entity\WhispeakAuth;
5
6
use Chamilo\CourseBundle\Entity\CQuiz;
7
use Chamilo\CourseBundle\Entity\CQuizQuestion;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * Class LogEventQuiz.
12
 *
13
 * @package Chamilo\PluginBundle\Entity\WhispeakAuth
14
 *
15
 * @ORM\Entity()
16
 */
17
class LogEventQuiz extends LogEvent
18
{
19
    /**
20
     * @var CQuizQuestion
21
     *
22
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CQuizQuestion")
23
     * @ORM\JoinColumn(name="question_id", referencedColumnName="iid")
24
     */
25
    private $question;
26
    /**
27
     * @var CQuiz
28
     *
29
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CQuiz")
30
     * @ORM\JoinColumn(name="quiz_id", referencedColumnName="iid")
31
     */
32
    private $quiz;
33
34
    /**
35
     * @return CQuizQuestion
36
     */
37
    public function getQuestion()
38
    {
39
        return $this->question;
40
    }
41
42
    /**
43
     * @param CQuizQuestion $question
44
     *
45
     * @return LogEventQuiz
46
     */
47
    public function setQuestion($question)
48
    {
49
        $this->question = $question;
50
51
        return $this;
52
    }
53
54
    /**
55
     * @return CQuiz
56
     */
57
    public function getQuiz()
58
    {
59
        return $this->quiz;
60
    }
61
62
    /**
63
     * @param CQuiz $quiz
64
     *
65
     * @return LogEventQuiz
66
     */
67
    public function setQuiz($quiz)
68
    {
69
        $this->quiz = $quiz;
70
71
        return $this;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getTypeString()
78
    {
79
        $quiz = strip_tags($this->getQuiz()->getTitle());
80
        $question = strip_tags($this->getQuestion()->getQuestion());
81
82
        return "$quiz > $question";
83
    }
84
}
85