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

OrganizationImageMetadata   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 4
eloc 7
dl 0
loc 30
rs 10
c 2
b 1
f 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getOwnerFileClass() 0 3 1
A setOrganization() 0 4 1
A getOrganization() 0 3 1
A getResourceId() 0 3 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
}