Passed
Push — feature/uploadable ( 679758...63d03b )
by Daniel
05:40
created

AbstractPage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 30
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Components Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentsBundle\Entity\Core;
15
16
use Silverback\ApiComponentsBundle\Annotation as Silverback;
17
use Silverback\ApiComponentsBundle\Entity\Utility\IdTrait;
18
use Silverback\ApiComponentsBundle\Entity\Utility\TimestampedTrait;
19
20
/**
21
 * @author Daniel West <[email protected]>
22
 *
23
 * @Silverback\Timestamped
24
 *
25
 * @internal
26
 */
27
abstract class AbstractPage
28
{
29
    use IdTrait;
30
    use TimestampedTrait;
31
32
    public ?Route $route;
33
34
    /**
35
     * This will be se so that when auto-generating a route for a newly created
36
     * PageTemplate / PageData, we can prepend parent routes.
37
     */
38
    public ?Route $parentRoute;
39
40
    /**
41
     * If true, then the PageTemplate/PageData is nested within the parentRoute.
42
     * So not only will any auto-generated route have the parent route prefixes,
43
     * the front end should expect to load the PageTemplate/PageData nested within
44
     * the parent page(s) up to the point where a parent is defined as not nested or
45
     * does not have a parent route
46
     * E.g. the parent route's page may just be a Hero and some Tab navigation.
47
     */
48
    public bool $isNested = true;
49
50
    public string $title = 'Unnamed Page';
51
52
    public ?string $metaDescription;
53
54 1
    public function __construct()
55
    {
56 1
        $this->setId();
57 1
    }
58
}
59