Completed
Push — master ( d66330...eb9ee0 )
by Grégoire
02:15
created

Gallery::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Tests\App\Entity;
15
16
use Doctrine\ORM\Mapping as ORM;
17
use Sonata\MediaBundle\Entity\BaseGallery;
18
use Sonata\MediaBundle\Model\GalleryItemInterface;
19
20
/**
21
 * @ORM\Entity
22
 * @ORM\Table(name="media__gallery")
23
 */
24
class Gallery extends BaseGallery
25
{
26
    /**
27
     * @ORM\Id
28
     * @ORM\GeneratedValue
29
     * @ORM\Column(type="integer")
30
     */
31
    protected $id;
32
33
    /**
34
     * Get id.
35
     */
36
    public function getId(): int
37
    {
38
        return $this->id;
39
    }
40
41
    public function removeGalleryItem(GalleryItemInterface $galleryItem)
42
    {
43
        if ($this->galleryItems->contains($galleryItem)) {
44
            $this->galleryItems->removeElement($galleryItem);
45
        }
46
    }
47
}
48