Subscription   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 37
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAuthor() 0 4 1
A getSubscriber() 0 4 1
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