Passed
Push — develop ( 683c8d...07cc15 )
by Daniel
05:33
created

Gallery::onDeleteCascade()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Component\Gallery;
4
5
use ApiPlatform\Core\Annotation\ApiResource;
6
use Doctrine\ORM\Mapping as ORM;
7
use Silverback\ApiComponentBundle\Entity\Component\AbstractComponent;
8
use Silverback\ApiComponentBundle\Entity\Content\ComponentGroup;
9
10
/**
11
 * Class Gallery
12
 * @package Silverback\ApiComponentBundle\Entity\Component\Gallery
13
 * @author Daniel West <[email protected]>
14
 * @ApiResource(shortName="component/gallery")
15
 * @ORM\Entity()
16
 */
17
class Gallery extends AbstractComponent
18
{
19 1
    public function __construct()
20
    {
21 1
        parent::__construct();
22 1
        $this->addValidComponent(GalleryItem::class);
23 1
        $this->addComponentGroup(new ComponentGroup());
24 1
    }
25
26
    public function onDeleteCascade(): bool
27
    {
28
        return true;
29
    }
30
}
31