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

LogEventLp   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 66
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getTypeString() 0 6 1
A setLp() 0 5 1
A setLpItem() 0 5 1
A getLp() 0 3 1
A getLpItem() 0 3 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\PluginBundle\Entity\WhispeakAuth;
5
6
use Chamilo\CourseBundle\Entity\CLp;
7
use Chamilo\CourseBundle\Entity\CLpItem;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * Class LogEventLp.
12
 *
13
 * @package Chamilo\PluginBundle\Entity\WhispeakAuth
14
 *
15
 * @ORM\Entity()
16
 */
17
class LogEventLp extends LogEvent
18
{
19
    /**
20
     * @var CLpItem
21
     *
22
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CLpItem")
23
     * @ORM\JoinColumn(name="lp_item_id", referencedColumnName="iid")
24
     */
25
    private $lpItem;
26
    /**
27
     * @var CLp
28
     *
29
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CLp")
30
     * @ORM\JoinColumn(name="lp_id", referencedColumnName="iid")
31
     */
32
    private $lp;
33
34
    /**
35
     * @return CLpItem
36
     */
37
    public function getLpItem()
38
    {
39
        return $this->lpItem;
40
    }
41
42
    /**
43
     * @param CLpItem $lpItem
44
     *
45
     * @return LogEventLp
46
     */
47
    public function setLpItem($lpItem)
48
    {
49
        $this->lpItem = $lpItem;
50
51
        return $this;
52
    }
53
54
    /**
55
     * @return CLp
56
     */
57
    public function getLp()
58
    {
59
        return $this->lp;
60
    }
61
62
    /**
63
     * @param CLp $lp
64
     *
65
     * @return LogEventLp
66
     */
67
    public function setLp($lp)
68
    {
69
        $this->lp = $lp;
70
71
        return $this;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getTypeString()
78
    {
79
        $lpName = $this->lp->getName();
80
        $itemTitle = $this->getLpItem()->getTitle();
81
82
        return "$lpName > $itemTitle";
83
    }
84
}
85