Issues (3627)

app/bundles/LeadBundle/Entity/CompanyChangeLog.php (1 issue)

1
<?php
2
3
/*
4
 * @copyright   2014 Mautic Contributors. All rights reserved
5
 * @author      Mautic
6
 *
7
 * @link        http://mautic.org
8
 *
9
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
 */
11
12
namespace Mautic\LeadBundle\Entity;
13
14
use Doctrine\ORM\Mapping as ORM;
15
use Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder;
16
17
/**
18
 * Class PointsChangeLog.
19
 */
20
class CompanyChangeLog
21
{
22
    /**
23
     * @var int
24
     */
25
    private $id;
26
27
    /**
28
     * @var Lead
29
     */
30
    private $lead;
31
32
    /**
33
     * @var string
34
     */
35
    private $type;
36
37
    /**
38
     * @var string
39
     */
40
    private $eventName;
41
42
    /**
43
     * @var string
44
     */
45
    private $actionName;
46
47
    /**
48
     * @var Company
49
     */
50
    private $company;
51
52
    /**
53
     * @var \DateTime
54
     */
55
    private $dateAdded;
56
57
    public static function loadMetadata(ORM\ClassMetadata $metadata)
58
    {
59
        $builder = new ClassMetadataBuilder($metadata);
60
61
        $builder->setTable('lead_companies_change_log')
62
            ->setCustomRepositoryClass('Mautic\LeadBundle\Entity\CompanyChangeLogRepository')
63
            ->addIndex(['date_added'], 'company_date_added');
64
65
        $builder->addId();
66
67
        $builder->addLead(false, 'CASCADE', false, 'companyChangeLog');
0 ignored issues
show
Deprecated Code introduced by
The function Mautic\CoreBundle\Doctri...adataBuilder::addLead() has been deprecated: Use addContact instead; existing implementations will need a migration to rename lead_id to contact_id ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

67
        /** @scrutinizer ignore-deprecated */ $builder->addLead(false, 'CASCADE', false, 'companyChangeLog');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
68
69
        $builder->createField('type', 'text')
70
            ->length(50)
71
            ->build();
72
73
        $builder->createField('eventName', 'string')
74
            ->columnName('event_name')
75
            ->build();
76
77
        $builder->createField('actionName', 'string')
78
            ->columnName('action_name')
79
            ->build();
80
81
        $builder->createField('company', 'integer')
82
            ->columnName('company_id')
83
            ->build();
84
85
        $builder->addDateAdded();
86
    }
87
88
    /**
89
     * Get id.
90
     *
91
     * @return int
92
     */
93
    public function getId()
94
    {
95
        return $this->id;
96
    }
97
98
    /**
99
     * Set type.
100
     *
101
     * @param string $type
102
     *
103
     * @return CompanyChangeLog
104
     */
105
    public function setType($type)
106
    {
107
        $this->type = $type;
108
109
        return $this;
110
    }
111
112
    /**
113
     * Get type.
114
     *
115
     * @return string
116
     */
117
    public function getType()
118
    {
119
        return $this->type;
120
    }
121
122
    /**
123
     * Set eventName.
124
     *
125
     * @param string $eventName
126
     *
127
     * @return CompanyChangeLog
128
     */
129
    public function setEventName($eventName)
130
    {
131
        $this->eventName = $eventName;
132
133
        return $this;
134
    }
135
136
    /**
137
     * Get eventName.
138
     *
139
     * @return string
140
     */
141
    public function getEventName()
142
    {
143
        return $this->eventName;
144
    }
145
146
    /**
147
     * Set actionName.
148
     *
149
     * @param string $actionName
150
     *
151
     * @return CompanyChangeLog
152
     */
153
    public function setActionName($actionName)
154
    {
155
        $this->actionName = $actionName;
156
157
        return $this;
158
    }
159
160
    /**
161
     * Get actionName.
162
     *
163
     * @return string
164
     */
165
    public function getActionName()
166
    {
167
        return $this->actionName;
168
    }
169
170
    /**
171
     * Set delta.
172
     *
173
     * @param Company $company
174
     *
175
     * @return CompanyChangeLog
176
     */
177
    public function setCompany($company)
178
    {
179
        $this->company = $company;
180
181
        return $this;
182
    }
183
184
    /**
185
     * Get company.
186
     *
187
     * @return \Mautic\LeadBundle\Entity\Company
188
     */
189
    public function getCompany()
190
    {
191
        return $this->company;
192
    }
193
194
    /**
195
     * Set dateAdded.
196
     *
197
     * @param \DateTime $dateAdded
198
     *
199
     * @return CompanyChangeLog
200
     */
201
    public function setDateAdded($dateAdded)
202
    {
203
        $this->dateAdded = $dateAdded;
204
205
        return $this;
206
    }
207
208
    /**
209
     * Get dateAdded.
210
     *
211
     * @return \DateTime
212
     */
213
    public function getDateAdded()
214
    {
215
        return $this->dateAdded;
216
    }
217
218
    /**
219
     * Set lead.
220
     *
221
     * @return CompanyChangeLog
222
     */
223
    public function setLead(\Mautic\LeadBundle\Entity\Lead $lead)
224
    {
225
        $this->lead = $lead;
226
227
        return $this;
228
    }
229
230
    /**
231
     * Get lead.
232
     *
233
     * @return \Mautic\LeadBundle\Entity\Lead
234
     */
235
    public function getLead()
236
    {
237
        return $this->lead;
238
    }
239
}
240