Completed
Push — master ( 535b09...0667cb )
by
unknown
56:23
created

LeadPhone::getOwner()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace OroCRM\Bundle\SalesBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
8
use OroCRM\Bundle\SalesBundle\Model\ExtendLeadPhone;
9
10
/**
11
 * @ORM\Entity
12
 * @ORM\Table("orocrm_sales_lead_phone", indexes={
13
 *      @ORM\Index(name="primary_phone_idx", columns={"phone", "is_primary"}),
14
 *      @ORM\Index(name="phone_idx", columns={"phone"})
15
 * })
16
 * @Config(
17
 *      defaultValues={
18
 *          "entity"={
19
 *              "icon"="icon-phone"
20
 *          },
21
 *          "note"={
22
 *              "immutable"=true
23
 *          },
24
 *          "comment"={
25
 *              "immutable"=true
26
 *          },
27
 *          "activity"={
28
 *              "immutable"=true
29
 *          },
30
 *          "attachment"={
31
 *              "immutable"=true
32
 *          },
33
 *          "dataaudit"={
34
 *              "auditable"=true
35
 *          }
36
 *      }
37
 * )
38
 */
39
class LeadPhone extends ExtendLeadPhone
40
{
41
    /**
42
     * @ORM\ManyToOne(targetEntity="Lead", inversedBy="phones")
43
     * @ORM\JoinColumn(name="owner_id", referencedColumnName="id", onDelete="CASCADE")
44
     */
45
    protected $owner;
46
47
    /**
48
     * Set Lead as owner.
49
     *
50
     * @param Lead $owner
51
     */
52
    public function setOwner(Lead $owner = null)
53
    {
54
        $this->owner = $owner;
55
    }
56
57
    /**
58
     * Get owner Lead.
59
     *
60
     * @return Lead
61
     */
62
    public function getOwner()
63
    {
64
        return $this->owner;
65
    }
66
}
67