CmsGroup::addUser()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/* 
3
 * To change this template, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
7
namespace Doctrine\Tests\Models\CMS;
8
9
/**
10
 * @Document
11
 */
12
class CmsGroup
13
{
14
    /** @Id */
15
    public $id;
16
    /** @Field(type="string") */
17
    public $name;
18
19
    /** @ReferenceMany(targetDocument="CmsUser", mappedBy="groups") */
20
    public $users;
21
22
    public function setName($name) {
23
        $this->name = $name;
24
    }
25
26
    public function getName() {
27
        return $this->name;
28
    }
29
30
    public function addUser(CmsUser $user) {
31
        $this->users[] = $user;
32
    }
33
34
    public function getUsers() {
35
        return $this->users;
36
    }
37
}
38
39