Completed
Push — master ( 6cc2de...ecdd96 )
by Adrien
02:40
created

AbstractModel::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLTests\Doctrine\Blog\Model;
6
7
use DateTime;
8
use Doctrine\ORM\Mapping as ORM;
9
use GraphQL\Doctrine\Annotation as API;
10
11
/**
12
 * Base class for all objects stored in database.
13
 *
14
 * @ORM\MappedSuperclass
15
 */
16
abstract class AbstractModel
17
{
18
    /**
19
     * @var int
20
     *
21
     * @ORM\Column(type="integer", options={"unsigned" = true})
22
     * @ORM\Id
23
     * @ORM\GeneratedValue(strategy="IDENTITY")
24
     */
25
    protected $id;
26
27
    /**
28
     * @ORM\Column(type="datetime")
29
     */
30
    private $creationDate;
31
32
    public function getId(): int
33
    {
34
        return $this->id;
35
    }
36
37
    /**
38
     * @API\Field(type="GraphQLTests\Doctrine\Blog\Types\DateTimeType")
39
     */
40
    public function getCreationDate(): DateTime
41
    {
42
        return $this->creationDate;
43
    }
44
45
    /**
46
     * @API\Input(type="GraphQLTests\Doctrine\Blog\Types\DateTimeType")
47
     */
48
    public function setCreationDate(DateTime $creationDate): void
49
    {
50
        $this->creationDate = $creationDate;
51
    }
52
}
53