Ressource::toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 3
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3 View Code Duplication
class Ressource extends \Phalcon\Mvc\Model
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
6
    /**
7
     *
8
     * @var integer
9
     */
10
    protected $id;
11
12
    /**
13
     *
14
     * @var string
15
     */
16
    protected $libelle;
17
18
    /**
19
     * Method to set the value of field id
20
     *
21
     * @param integer $id
22
     * @return $this
23
     */
24
    public function setId($id)
25
    {
26
        $this->id = $id;
27
28
        return $this;
29
    }
30
31
    /**
32
     * Method to set the value of field libelle
33
     *
34
     * @param string $libelle
35
     * @return $this
36
     */
37
    public function setLibelle($libelle)
38
    {
39
        $this->libelle = $libelle;
40
41
        return $this;
42
    }
43
44
    /**
45
     * Returns the value of field id
46
     *
47
     * @return integer
48
     */
49
    public function getId()
50
    {
51
        return $this->id;
52
    }
53
54
    /**
55
     * Returns the value of field libelle
56
     *
57
     * @return string
58
     */
59
    public function getLibelle()
60
    {
61
        return $this->libelle;
62
    }
63
    
64
    /**
65
     * Initialize method for model.
66
     */
67
    public function initialize()
68
    {
69
        $this->hasMany('id', 'Acl', 'idRessource', array('alias' => 'Acl'));
70
    }
71
72
    /**
73
     * Returns table name mapped in the model.
74
     *
75
     * @return string
76
     */
77
    public function getSource()
78
    {
79
        return 'ressource';
80
    }
81
82
    /**
83
     * Allows to query a set of records that match the specified conditions
84
     *
85
     * @param mixed $parameters
86
     * @return Ressource[]
87
     */
88
    public static function find($parameters = null)
89
    {
90
        return parent::find($parameters);
91
    }
92
93
    /**
94
     * Allows to query the first record that match the specified conditions
95
     *
96
     * @param mixed $parameters
97
     * @return Ressource
98
     */
99
    public static function findFirst($parameters = null)
100
    {
101
        return parent::findFirst($parameters);
102
    }
103
    
104
    public function toString() {
105
    	return $this->libelle;
106
    }
107
108
}
109