Test Failed
Push — master ( 24a173...6e5e04 )
by Alexey
03:01
created

Subscription   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
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 53
rs 10
c 0
b 0
f 0
ccs 0
cts 7
cp 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
 * Subscription
9
 *
10
 * @ORM\Table(name="subscriptions", schema="subscriptions", uniqueConstraints={
11
 *      @ORM\UniqueConstraint(name="subscription_unique", columns={"author_id", "subscriber_id"})}
12
 * )
13
 * @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionRepository")
14
 */
15
class Subscription
16
{
17
    /**
18
     * @var User
19
     *
20
     * @ORM\Id
21
     * @ORM\ManyToOne(targetEntity="User", inversedBy="subscribers")
22
     * @ORM\JoinColumn(name="author_id")
23
     */
24
    private $author;
25
26
    /**
27
     * @var User
28
     *
29
     * @ORM\Id
30
     * @ORM\ManyToOne(targetEntity="User", inversedBy="subscriptions")
31
     * @ORM\JoinColumn(name="subscriber_id")
32
     */
33
    private $subscriber;
34
35
36
    /**
37
     * Subscription constructor.
38
     *
39
     * @param User $author
40
     * @param User $subscriber
41
     */
42
    public function __construct(User $author = null, User $subscriber = null)
43
    {
44
        $this->author = $author;
45
        $this->subscriber = $subscriber;
46
    }
47
48
    /**
49
     * Get author
50
     *
51
     * @return User
52
     */
53
    public function getAuthor()
54
    {
55
        return $this->author;
56
    }
57
58
    /**
59
     * Get subscriber
60
     *
61
     * @return User
62
     */
63
    public function getSubscriber()
64
    {
65
        return $this->subscriber;
66
    }
67
}
68