AccountCharacter::getCharacterName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Tarioch\EveapiFetcherBundle\Entity;
3
4
use Doctrine\ORM\Mapping as ORM;
5
6
/**
7
 * @ORM\Entity
8
 * @ORM\Table(name="accountCharacter", indexes={
9
 *     @ORM\Index(name="characterID", columns={"characterId"}),
10
 *     @ORM\Index(name="corporationID", columns={"corporationId"})
11
 * })
12
 */
13
class AccountCharacter
14
{
15
    /**
16
     * @ORM\Id @ORM\GeneratedValue @ORM\Column(name="ID", type="bigint", options={"unsigned"=true})
17
     */
18
    private $id;
19
20
    /**
21
     * @ORM\Column(name="characterID", type="bigint", options={"unsigned"=true})
22
     */
23
    private $characterId;
24
25
    /**
26
     * @ORM\Column(name="characterName", type="string")
27
     */
28
    private $characterName;
29
30
    /**
31
     * @ORM\Column(name="corporationID", type="bigint", options={"unsigned"=true})
32
     */
33
    private $corporationId;
34
35
    /**
36
     * @ORM\Column(name="corporationName", type="string")
37
     */
38
    private $corporationName;
39
40
    /**
41
     * @ORM\ManyToOne(targetEntity="ApiKey", fetch="EAGER")
42
     * @ORM\JoinColumn(name="keyID", referencedColumnName="keyID", nullable=false, onDelete="cascade")
43
     */
44
    private $key;
45
46
    public function __construct(ApiKey $key, $characterId)
47
    {
48
        $this->key = $key;
49
        $this->characterId = $characterId;
50
    }
51
52
    public function getId()
53
    {
54
        return $this->id;
55
    }
56
57
    public function getKey()
58
    {
59
        return $this->key;
60
    }
61
62
    public function getCharacterId()
63
    {
64
        return $this->characterId;
65
    }
66
67
    public function getCharacterName()
68
    {
69
        return $this->characterName;
70
    }
71
72
    public function setCharacterName($characterName)
73
    {
74
        $this->characterName = $characterName;
75
    }
76
77
    public function getCorporationId()
78
    {
79
        return $this->corporationId;
80
    }
81
82
    public function setCorporationId($corporationId)
83
    {
84
        $this->corporationId = $corporationId;
85
    }
86
87
    public function getCorporationName()
88
    {
89
        return $this->corporationName;
90
    }
91
92
    public function setCorporationName($corporationName)
93
    {
94
        $this->corporationName = $corporationName;
95
    }
96
97
    public function __toString()
98
    {
99
        return $this->id . ': characterId: ' . $this->characterId . ' corpId: ' . $this->corporationId;
100
    }
101
}
102