Failed Conditions
Push — master ( cdc595...f2bb18 )
by Adrien
02:12
created

AbstractModel::setOwner()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Blog\Model;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use Ecodev\Felix\Model\HasOwner;
9
use Ecodev\Felix\Model\Model;
10
11
/**
12
 * Base class for all objects stored in database.
13
 *
14
 * @ORM\MappedSuperclass
15
 */
16
abstract class AbstractModel implements Model, HasOwner
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
     * @var null|User
29
     */
30
    private $owner;
31
32
    public function getId(): ?int
33
    {
34
        return $this->id;
35
    }
36
37
    /**
38
     * @return null|User
39
     */
40
    public function getOwner(): ?\Ecodev\Felix\Model\User
41
    {
42
        return $this->owner;
43
    }
44
45
    /**
46
     * @param null|User $owner
47
     */
48
    public function setOwner(?User $owner): void
49
    {
50
        $this->owner = $owner;
51
    }
52
}
53