Passed
Push — feature/uploadable ( 7c6d25...a7ed20 )
by Daniel
11:07
created

AbstractPage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

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
    public function __construct()
55
    {
56
        $this->setId();
57
    }
58
}
59