Completed
Push — sf2.7 ( 18de34...b252b6 )
by Laurent
18:26
created

FamilyLog   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 91
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 91
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setName() 0 6 1
A getName() 0 4 1
A jsonSerialize() 0 7 1
A __toString() 0 4 1
A getSlug() 0 4 1
1
<?php
2
3
/**
4
 * Entité FamilyLog.
5
 *
6
 * PHP Version 5
7
 *
8
 * @author     Quétier Laurent <[email protected]>
9
 * @copyright  2014 Dev-Int GLSR
10
 * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
11
 *
12
 * @version    0.1.0
13
 *
14
 * @link       https://github.com/Dev-Int/glsr
15
 */
16
namespace AppBundle\Entity;
17
18
use Doctrine\ORM\Mapping as ORM;
19
use Gedmo\Mapping\Annotation as Gedmo;
20
21
/**
22
 * FamilyLog Entité FamilyLog.
23
 *
24
 * @category   Entity
25
 *
26
 * @ORM\Table(name="gs_familylog")
27
 * @ORM\Entity(repositoryClass="AppBundle\Entity\FamilyLogRepository")
28
 */
29
class FamilyLog implements \JsonSerializable
30
{
31
    /**
32
     * @var int Id de la famille logistique
33
     *
34
     * @ORM\Column(name="id", type="integer")
35
     * @ORM\Id
36
     * @ORM\GeneratedValue(strategy="AUTO")
37
     */
38
    private $id;
39
40
    /**
41
     * @var string Nom de la famille logistique
42
     *
43
     * @ORM\Column(name="name", type="string", length=255)
44
     */
45
    private $name;
46
    
47
    /**
48
     * @var string Slug name
49
     * @Gedmo\Slug(fields={"name"})
50
     * @ORM\Column(length=128, unique=true)
51
     */
52
    private $slug;
53
54
    /**
55
     * Get id.
56
     *
57
     * @return int
58
     */
59
    public function getId()
60
    {
61
        return $this->id;
62
    }
63
64
    /**
65
     * Set name.
66
     *
67
     * @param string $name Désignation
68
     *
69
     * @return FamilyLog
70
     */
71
    public function setName($name)
72
    {
73
        $this->name = $name;
74
75
        return $this;
76
    }
77
78
    /**
79
     * Get name.
80
     *
81
     * @return string
82
     */
83
    public function getName()
84
    {
85
        return $this->name;
86
    }
87
88
    public function jsonSerialize()
89
    {
90
        return array(
91
            'id'   => $this->id,
92
            'name' => $this->name,
93
        );
94
    }
95
96
    /**
97
     * Cette méthode permet de faire "echo $familyLog".
98
     * <p>Ainsi, pour "afficher" $familyLog,
99
     * PHP affichera en réalité le retour de cette méthode.<br />
100
     * Ici, le nom, donc "echo $familyLog"
101
     * est équivalent à "echo $familyLog->getName()"</p>.
102
     *
103
     * @return string name
104
     */
105
    public function __toString()
106
    {
107
        return $this->name;
108
    }
109
110
    /**
111
     * Get slug
112
     *
113
     * @return string 
114
     */
115
    public function getSlug()
116
    {
117
        return $this->slug;
118
    }
119
}
120