Issues (3627)

app/bundles/PointBundle/Entity/LeadTriggerLog.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\PointBundle\Entity;
13
14
use Doctrine\ORM\Mapping as ORM;
15
use Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder;
16
17
class LeadTriggerLog
18
{
19
    /**
20
     * @var TriggerEvent
21
     **/
22
    private $event;
23
24
    /**
25
     * @var \Mautic\LeadBundle\Entity\Lead
26
     **/
27
    private $lead;
28
29
    /**
30
     * @var \Mautic\CoreBundle\Entity\IpAddress
31
     **/
32
    private $ipAddress;
33
34
    /**
35
     * @var \DateTime
36
     **/
37
    private $dateFired;
38
39
    public static function loadMetadata(ORM\ClassMetadata $metadata)
40
    {
41
        $builder = new ClassMetadataBuilder($metadata);
42
43
        $builder->setTable('point_lead_event_log')
44
            ->setCustomRepositoryClass(LeadTriggerLogRepository::class);
45
46
        $builder->createManyToOne('event', 'TriggerEvent')
47
            ->isPrimaryKey()
48
            ->addJoinColumn('event_id', 'id', false, false, 'CASCADE')
49
            ->inversedBy('log')
50
            ->build();
51
52
        $builder->addLead(false, 'CASCADE', true);
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

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

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...
53
54
        $builder->addIpAddress(true);
55
56
        $builder->createField('dateFired', 'datetime')
57
            ->columnName('date_fired')
58
            ->build();
59
    }
60
61
    /**
62
     * @return mixed
63
     */
64
    public function getDateFired()
65
    {
66
        return $this->dateFired;
67
    }
68
69
    /**
70
     * @param mixed $dateFired
71
     */
72
    public function setDateFired($dateFired)
73
    {
74
        $this->dateFired = $dateFired;
75
    }
76
77
    /**
78
     * @return mixed
79
     */
80
    public function getIpAddress()
81
    {
82
        return $this->ipAddress;
83
    }
84
85
    /**
86
     * @param mixed $ipAddress
87
     */
88
    public function setIpAddress($ipAddress)
89
    {
90
        $this->ipAddress = $ipAddress;
91
    }
92
93
    /**
94
     * @return mixed
95
     */
96
    public function getLead()
97
    {
98
        return $this->lead;
99
    }
100
101
    /**
102
     * @param mixed $lead
103
     */
104
    public function setLead($lead)
105
    {
106
        $this->lead = $lead;
107
    }
108
109
    /**
110
     * @return mixed
111
     */
112
    public function getEvent()
113
    {
114
        return $this->event;
115
    }
116
117
    /**
118
     * @param mixed $event
119
     */
120
    public function setEvent($event)
121
    {
122
        $this->event = $event;
123
    }
124
}
125