Passed
Push — master ( 21a45d...334091 )
by Petr
03:48
created

AmbassadorMember::setDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace AppBundle\Entity\Infrasctucture;
4
5
use AppBundle\Entity\User;
6
use Doctrine\ORM\Mapping as ORM;
7
use JMS\Serializer\Annotation as Serializer;
8
9
/**
10
 * @author Vehsamrak
11
 * @ORM\MappedSuperclass
12
 */
13
abstract class AmbassadorMember
14
{
15
16
    use GetUserLoginTrait;
17
18
    /**
19
     * @ORM\Id
20
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
21
     * @ORM\JoinColumn(name="user_id", referencedColumnName="login")
22
     * @Serializer\Accessor("getUserLogin")
23
     * @Serializer\Type("string")
24
     * @Serializer\SerializedName("login")
25
     */
26
    protected $user;
27
28
    /**
29
     * @var string
30
     * @ORM\Column(name="short_description", type="text", nullable=false)
31
     * @Serializer\SerializedName("short_description")
32
     */
33
    protected $shortDescription;
34
35
    /**
36
     * @var string
37
     * @ORM\Column(name="description", type="text", nullable=true)
38
     */
39
    protected $description;
40
41
    /**
42
     * @var Ambassador
43
     */
44
    protected $ambassador;
45
46 5
    public function __construct(
47
        Ambassador $ambassador,
48
        User $user,
49
        string $shortDescription = '',
50
        string $description = null
51
    ) {
52 5
        $this->user = $user;
53 5
        $this->ambassador = $ambassador;
54 5
        $this->shortDescription = $shortDescription;
55 5
        $this->description = $description;
56 5
    }
57
58 1
    public function setShortDescription(string $shortDescription)
59
    {
60 1
        $this->shortDescription = $shortDescription;
61 1
    }
62
63 1
    public function setDescription(string $description)
64
    {
65 1
        $this->description = $description;
66 1
    }
67
}
68