Passed
Push — master ( 240c83...03f39b )
by Mathias
06:41
created

ContactImageMetadata::preRemove()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cv\Entity;
6
7
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
8
use Core\Entity\ImageMetadata;
9
10
/**
11
 * Class ContactImageMetadata
12
 * @ODM\EmbeddedDocument
13
 * @ODM\HasLifecycleCallbacks()
14
 * @package Cv\Entity
15
 */
16
class ContactImageMetadata extends ImageMetadata
17
{
18
    /**
19
     * @var Contact
20
     */
21
    protected Contact $contact;
22
23
    /**
24
     * @return Contact
25
     */
26
    public function getContact(): Contact
27
    {
28
        return $this->contact;
29
    }
30
31
    public function setContact(Contact $contact)
32
    {
33
        $this->contact = $contact;
34
        return $this;
35
    }
36
37
    /**
38
     * @ODM\PreRemove
39
     */
40
    public function preRemove()
41
    {
42
        $this->contact->setImage(null);
43
    }
44
}