Completed
Pull Request — dev (#25)
by nonanerz
03:34
created

Event::getGoogleId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
8
9
/**
10
 * Event.
11
 *
12
 * @ORM\Table(name="event")
13
 * @ORM\Entity(repositoryClass="AppBundle\Repository\EventRepository")
14
 */
15
class Event
16
{
17
    use ORMBehaviors\Timestampable\Timestampable;
18
19
    /**
20
     * @var int
21
     *
22
     * @ORM\Column(name="id", type="integer")
23
     * @ORM\Id
24
     * @ORM\GeneratedValue(strategy="AUTO")
25
     */
26
    private $id;
27
28
    /**
29
     * @var string
30
     *
31
     * @ORM\Column(name="name", type="string", length=255)
32
     */
33
    private $googleId;
34
35
    /**
36
     * @var ArrayCollection|$users[]
37
     * @ORM\ManyToMany(targetEntity="AppBundle\Entity\User", mappedBy="events")
38
     */
39
    private $users = [];
40
41
    public function __construct()
42
    {
43
        $this->users = new ArrayCollection();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Doctrine\Common\Collections\ArrayCollection() of type object<Doctrine\Common\C...ctions\ArrayCollection> is incompatible with the declared type array of property $users.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
44
    }
45
46
    /**
47
     * Get id.
48
     *
49
     * @return int
50
     */
51
    public function getId()
52
    {
53
        return $this->id;
54
    }
55
56
    /**
57
     * @return ArrayCollection
58
     */
59
    public function getUsers()
60
    {
61
        return $this->users;
62
    }
63
64
    /**
65
     * @param $users
66
     *
67
     * @return $this
68
     */
69
    public function setUsers($users)
70
    {
71
        $this->users[] = $users;
72
73
        return $this;
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function getGoogleId()
80
    {
81
        return $this->googleId;
82
    }
83
84
    /**
85
     * @param string $googleId
86
     */
87
    public function setGoogleId($googleId)
88
    {
89
        $this->googleId = $googleId;
90
    }
91
}
92