Company   A
last analyzed

Complexity

Total Complexity 22

Size/Duplication

Total Lines 191
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 22
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 191
rs 10

22 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A setName() 0 5 1
A getLastname() 0 4 1
A setLastname() 0 5 1
A getStreet() 0 4 1
A setStreet() 0 5 1
A getZipCity() 0 4 1
A setZipCity() 0 5 1
A getIco() 0 4 1
A setIco() 0 5 1
A getDic() 0 4 1
A setDic() 0 5 1
A getEmail() 0 4 1
A setEmail() 0 5 1
A getPhone() 0 4 1
A setPhone() 0 5 1
A getActive() 0 4 1
A setActive() 0 5 1
A getCreated() 0 4 1
A setCreated() 0 5 1
A getBusinessmen() 0 4 1
A setBusinessmen() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of the Investform module for webcms2.
5
 * Copyright (c) @see LICENSE
6
 */
7
8
namespace WebCMS\InvestformModule\Entity;
9
10
use Doctrine\ORM\Mapping as ORM;
11
use Gedmo\Mapping\Annotation as gedmo;
12
13
/**
14
 * @ORM\Entity()
15
 * @ORM\Table(name="investform_Company")
16
 */
17
class Company extends \WebCMS\Entity\Entity
18
{
19
20
    /**
21
     * @ORM\Column(type="string", length=255)
22
     */
23
    private $name;
24
25
    /**
26
     * @ORM\Column(type="string", length=255)
27
     */
28
    private $street;
29
30
    /**
31
     * @ORM\Column(type="string", length=255)
32
     */
33
    private $zipCity;
34
35
    /**
36
     * @ORM\Column(type="string", length=255)
37
     */
38
    private $ico;
39
40
    /**
41
     * @ORM\Column(type="string", length=255)
42
     */
43
    private $dic;
44
45
	/**
46
	 * @ORM\Column(type="string", length=255)
47
	 */
48
	private $email;
49
50
    /**
51
     * @ORM\Column(type="string", length=255)
52
     */
53
    private $phone;
54
55
    /**
56
     * @ORM\Column(type="boolean")
57
     */
58
    private $active;
59
60
    /**
61
     * @var datetime $created
62
     * 
63
     * @gedmo\Timestampable(on="create")
64
     * @ORM\Column(type="datetime")
65
     */
66
    private $created;
67
68
    /**
69
     * @ORM\OneToMany(targetEntity="Businessman", mappedBy="company") 
70
     */
71
    private $businessmen;
72
73
74
    public function getName()
75
    {
76
        return $this->name;
77
    }
78
    
79
    public function setName($name)
80
    {
81
        $this->name = $name;
82
        return $this;
83
    }
84
85
    public function getLastname()
86
    {
87
        return $this->lastname;
0 ignored issues
show
Documentation introduced by
The property lastname does not exist on object<WebCMS\InvestformModule\Entity\Company>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
88
    }
89
    
90
    public function setLastname($lastname)
91
    {
92
        $this->lastname = $lastname;
0 ignored issues
show
Documentation introduced by
The property lastname does not exist on object<WebCMS\InvestformModule\Entity\Company>. Since you implemented __set, maybe consider adding a @property annotation.

Since your code implements the magic setter _set, this function will be called for any write access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

Since the property has write access only, you can use the @property-write annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
93
        return $this;
94
    }
95
96
    public function getStreet()
97
    {
98
        return $this->street;
99
    }
100
    
101
    public function setStreet($street)
102
    {
103
        $this->street = $street;
104
        return $this;
105
    }
106
107
    public function getZipCity()
108
    {
109
        return $this->zipCity;
110
    }
111
    
112
    public function setZipCity($zipCity)
113
    {
114
        $this->zipCity = $zipCity;
115
        return $this;
116
    }
117
118
    public function getIco()
119
    {
120
        return $this->ico;
121
    }
122
    
123
    public function setIco($ico)
124
    {
125
        $this->ico = $ico;
126
        return $this;
127
    }
128
129
    public function getDic()
130
    {
131
        return $this->dic;
132
    }
133
    
134
    public function setDic($dic)
135
    {
136
        $this->dic = $dic;
137
        return $this;
138
    }
139
140
    public function getEmail()
141
    {
142
        return $this->email;
143
    }
144
    
145
    public function setEmail($email)
146
    {
147
        $this->email = $email;
148
        return $this;
149
    }
150
151
    public function getPhone()
152
    {
153
        return $this->phone;
154
    }
155
    
156
    public function setPhone($phone)
157
    {
158
        $this->phone = $phone;
159
        return $this;
160
    }
161
162
    public function getActive()
163
    {
164
        return $this->active;
165
    }
166
    
167
    public function setActive($active)
168
    {
169
        $this->active = $active;
170
        return $this;
171
    }
172
173
    public function getCreated()
174
    {
175
        return $this->created;
176
    }
177
    
178
    public function setCreated($created)
179
    {
180
        $this->created = $created;
181
        return $this;
182
    }
183
184
    /**
185
     * Gets the value of businessmen.
186
     *
187
     * @return mixed
188
     */
189
    public function getBusinessmen()
190
    {
191
        return $this->businessmen;
192
    }
193
194
    /**
195
     * Sets the value of businessmen.
196
     *
197
     * @param mixed $businessmen the businessmen
198
     *
199
     * @return self
200
     */
201
    public function setBusinessmen($businessmen)
202
    {
203
        $this->businessmen = $businessmen;
204
        return $this;
205
    }
206
207
}
208