Completed
Pull Request — master (#8)
by Nicolas
28:01
created

Author::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Smart\ContentBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Timestampable\Traits\TimestampableEntity;
7
use Smart\ContentBundle\Entity\Traits\ContentTrait;
8
use Smart\ContentBundle\Entity\Traits\ImageTrait;
9
use Smart\ContentBundle\Entity\Traits\NameableTrait;
10
use Smart\ContentBundle\Entity\Traits\SeoTrait;
11
use Symfony\Component\HttpFoundation\File\File;
12
use Symfony\Component\HttpFoundation\File\UploadedFile;
13
use Vich\UploaderBundle\Mapping\Annotation as Vich;
14
use Symfony\Component\Validator\Constraints as Assert;
15
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
16
17
/**
18
 * Nicolas Bastien <[email protected]>
19
 *
20
 * @ORM\Entity(repositoryClass="Smart\ContentBundle\Entity\Repository\AuthorRepository")
21
 * @ORM\Table(name="smart_content_author")
22
 *
23
 * @Vich\Uploadable
24
 * @UniqueEntity({"name"})
25
 * @UniqueEntity({"url"})
26
 */
27
class Author
28
{
29
    use NameableTrait;
30
    use ImageTrait;
31
    use ContentTrait;
32
    use SeoTrait;
33
34
    /**
35
     * @var int
36
     *
37
     * @ORM\Id
38
     * @ORM\Column(name="id", type="integer")
39
     * @ORM\GeneratedValue(strategy="AUTO")
40
     */
41
    protected $id;
42
43
    public function __toString()
44
    {
45
        return (string) $this->getName();
46
    }
47
48
    /**
49
     * @return int
50
     */
51
    public function getId()
52
    {
53
        return $this->id;
54
    }
55
56
    /**
57
     * @param int $id
58
     */
59
    public function setId($id)
60
    {
61
        $this->id = $id;
62
    }
63
}
64