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

OrganizationImageMetadata::setOrganization()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 1
b 0
f 1
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Organizations\Entity;
6
7
use Core\Entity\ImageMetadata as BaseImageMetadata;
8
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
9
10
/**
11
 * Class Image
12
 *
13
 * @ODM\EmbeddedDocument
14
 * @package Organizations\Entity
15
 */
16
class OrganizationImageMetadata extends BaseImageMetadata
17
{
18
    /**
19
     * Organization which belongs to the company logo
20
     * @ODM\ReferenceOne(targetDocument="Organizations\Entity\Organization", storeAs="id")
21
     */
22
    protected ?OrganizationInterface $organization;
23
24
    public function getResourceId()
25
    {
26
        return 'Entity/OrganizationImage';
27
    }
28
29
    public function getOwnerFileClass(): string
30
    {
31
        return OrganizationImage::class;
32
    }
33
34
    /**
35
     * @return OrganizationInterface|null
36
     */
37
    public function getOrganization(): ?OrganizationInterface
38
    {
39
        return $this->organization;
40
    }
41
42
    public function setOrganization(?OrganizationInterface $organization)
43
    {
44
        $this->organization = $organization;
45
        return $this;
46
    }
47
}