Subscription::getAuthor()   A
last analyzed

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 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Table(name="subscriptions", schema="subscriptions")
9
 * @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionRepository", readOnly=true)
10
 */
11
class Subscription
12
{
13
    /**
14
     * @var User
15
     *
16
     * @ORM\Id
17
     * @ORM\ManyToOne(targetEntity="User", inversedBy="subscribers")
18
     * @ORM\JoinColumn(name="author_id")
19
     */
20
    private $author;
21
22
    /**
23
     * @var User
24
     *
25
     * @ORM\Id
26
     * @ORM\ManyToOne(targetEntity="User", inversedBy="subscriptions")
27
     * @ORM\JoinColumn(name="subscriber_id")
28
     */
29
    private $subscriber;
30
31
32
    public function __construct(User $author, User $subscriber)
33
    {
34
        $this->author = $author;
35
        $this->subscriber = $subscriber;
36
    }
37
38
    public function getAuthor(): User
39
    {
40
        return $this->author;
41
    }
42
43
    public function getSubscriber(): User
44
    {
45
        return $this->subscriber;
46
    }
47
}
48