Photo   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 56
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setPhoto() 0 5 1
A setProperty() 0 5 1
A getPhoto() 0 3 1
A getProperty() 0 3 1
A getSortOrder() 0 3 1
A setSortOrder() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Entity;
6
7
use App\Entity\Traits\EntityIdTrait;
8
use Doctrine\ORM\Mapping as ORM;
9
use Symfony\Component\Validator\Constraints as Assert;
10
11
/**
12
 * @ORM\Entity(repositoryClass="App\Repository\PhotoRepository")
13
 */
14
class Photo
15
{
16
    use EntityIdTrait;
17
18
    /**
19
     * @ORM\ManyToOne(targetEntity="App\Entity\Property", inversedBy="photos")
20
     * @ORM\JoinColumn(nullable=true)
21
     */
22
    private $property;
23
24
    /**
25
     * @ORM\Column(type="string", length=255)
26
     *
27
     * @Assert\File(mimeTypes={ "image/*" })
28
     */
29
    private $photo;
30
31
    /**
32
     * @ORM\Column(type="integer", nullable=true)
33
     */
34
    private ?int $sort_order;
35
36
    public function getProperty(): ?Property
37
    {
38
        return $this->property;
39
    }
40
41
    public function setProperty(?Property $property): self
42
    {
43
        $this->property = $property;
44
45
        return $this;
46
    }
47
48
    public function getPhoto()
49
    {
50
        return $this->photo;
51
    }
52
53
    public function setPhoto(string $photo): self
54
    {
55
        $this->photo = $photo;
56
57
        return $this;
58
    }
59
60
    public function getSortOrder(): ?int
61
    {
62
        return $this->sort_order;
63
    }
64
65
    public function setSortOrder(?int $sort_order): self
66
    {
67
        $this->sort_order = $sort_order;
68
69
        return $this;
70
    }
71
}
72