Issues (3627)

app/bundles/LeadBundle/Entity/StagesChangeLog.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
use Mautic\StageBundle\Entity\Stage;
17
18
/**
19
 * Class StagesChangeLog.
20
 */
21
class StagesChangeLog
22
{
23
    /**
24
     * @var int
25
     */
26
    private $id;
27
28
    /**
29
     * @var Lead
30
     */
31
    private $lead;
32
33
    /**
34
     * @var Stage
35
     */
36
    private $stage;
37
38
    /**
39
     * @var string
40
     */
41
    private $eventName;
42
43
    /**
44
     * @var string
45
     */
46
    private $actionName;
47
48
    /**
49
     * @var \DateTime
50
     */
51
    private $dateAdded;
52
53
    public static function loadMetadata(ORM\ClassMetadata $metadata)
54
    {
55
        $builder = new ClassMetadataBuilder($metadata);
56
57
        $builder->setTable('lead_stages_change_log')
58
            ->setCustomRepositoryClass('Mautic\LeadBundle\Entity\StagesChangeLogRepository');
59
60
        $builder->addId();
61
62
        $builder->addLead(false, 'CASCADE', false, 'stageChangeLog');
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

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

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...
63
64
        $builder->createField('eventName', 'string')
65
            ->columnName('event_name')
66
            ->build();
67
68
        $builder->createField('actionName', 'string')
69
            ->columnName('action_name')
70
            ->build();
71
72
        $builder->createManyToOne('stage', 'Mautic\StageBundle\Entity\Stage')
73
            ->inversedBy('log')
74
            ->addJoinColumn('stage_id', 'id', true, false, 'CASCADE')
75
            ->build();
76
77
        $builder->addDateAdded();
78
    }
79
80
    /**
81
     * Get id.
82
     *
83
     * @return int
84
     */
85
    public function getId()
86
    {
87
        return $this->id;
88
    }
89
90
    /**
91
     * Set eventName.
92
     *
93
     * @param string $eventName
94
     *
95
     * @return StagesChangeLog
96
     */
97
    public function setEventName($eventName)
98
    {
99
        $this->eventName = $eventName;
100
101
        return $this;
102
    }
103
104
    /**
105
     * Get eventName.
106
     *
107
     * @return string
108
     */
109
    public function getEventName()
110
    {
111
        return $this->eventName;
112
    }
113
114
    /**
115
     * Set actionName.
116
     *
117
     * @param string $actionName
118
     *
119
     * @return StagesChangeLog
120
     */
121
    public function setActionName($actionName)
122
    {
123
        $this->actionName = $actionName;
124
125
        return $this;
126
    }
127
128
    /**
129
     * Get actionName.
130
     *
131
     * @return string
132
     */
133
    public function getActionName()
134
    {
135
        return $this->actionName;
136
    }
137
138
    /**
139
     * Set dateAdded.
140
     *
141
     * @param \DateTime $dateAdded
142
     *
143
     * @return StagesChangeLog
144
     */
145
    public function setDateAdded($dateAdded)
146
    {
147
        $this->dateAdded = $dateAdded;
148
149
        return $this;
150
    }
151
152
    /**
153
     * Get dateAdded.
154
     *
155
     * @return \DateTime
156
     */
157
    public function getDateAdded()
158
    {
159
        return $this->dateAdded;
160
    }
161
162
    /**
163
     * Set lead.
164
     *
165
     * @return StagesChangeLog
166
     */
167
    public function setLead(\Mautic\LeadBundle\Entity\Lead $lead)
168
    {
169
        $this->lead = $lead;
170
171
        return $this;
172
    }
173
174
    /**
175
     * Get lead.
176
     *
177
     * @return \Mautic\LeadBundle\Entity\Lead
178
     */
179
    public function getLead()
180
    {
181
        return $this->lead;
182
    }
183
184
    /**
185
     * Set stage.
186
     *
187
     * @return StagesChangeLog
188
     */
189
    public function setStage(\Mautic\StageBundle\Entity\Stage $stage)
190
    {
191
        $this->stage = $stage;
192
193
        return $this;
194
    }
195
196
    /**
197
     * Get stage.
198
     *
199
     * @return \Mautic\StageBundle\Entity\Stage
200
     */
201
    public function getStage()
202
    {
203
        return $this->stage;
204
    }
205
}
206