Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
SlideLayout
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getLayoutName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setLayoutName
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getSlideMaster
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * This file is part of PHPPresentation - A pure PHP library for reading and writing
4 * presentations documents.
5 *
6 * PHPPresentation is free software distributed under the terms of the GNU Lesser
7 * General Public License version 3 as published by the Free Software Foundation.
8 *
9 * For the full copyright and license information, please read the LICENSE
10 * file that was distributed with this source code. For the full list of
11 * contributors, visit https://github.com/PHPOffice/PHPPresentation/contributors.
12 *
13 * @see        https://github.com/PHPOffice/PHPPresentation
14 *
15 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL version 3
16 */
17
18declare(strict_types=1);
19
20namespace PhpOffice\PhpPresentation\Slide;
21
22use PhpOffice\PhpPresentation\ComparableInterface;
23use PhpOffice\PhpPresentation\ShapeContainerInterface;
24use PhpOffice\PhpPresentation\Style\ColorMap;
25
26class SlideLayout extends AbstractSlide implements ComparableInterface, ShapeContainerInterface
27{
28    /**
29     * @var SlideMaster
30     */
31    protected $slideMaster;
32
33    /**
34     * Slide relation ID (should not be used by user code!).
35     *
36     * @var string
37     */
38    public $relationId;
39
40    /**
41     * Slide layout NR (should not be used by user code!).
42     *
43     * @var int
44     */
45    public $layoutNr;
46
47    /**
48     * Slide layout ID (should not be used by user code!).
49     *
50     * @var int
51     */
52    public $layoutId;
53
54    /**
55     * Slide layout ID (should not be used by user code!).
56     *
57     * @var null|string
58     */
59    protected $layoutName;
60
61    /**
62     * Mapping of colors to the theme.
63     *
64     * @var ColorMap
65     */
66    public $colorMap;
67
68    /**
69     * Create a new slideLayout.
70     */
71    public function __construct(SlideMaster $pSlideMaster)
72    {
73        // Set parent
74        $this->slideMaster = $pSlideMaster;
75        // Set identifier
76        $this->identifier = md5(mt_rand(0, 9999) . time());
77        // Set a basic colorMap
78        $this->colorMap = new ColorMap();
79    }
80
81    public function getLayoutName(): ?string
82    {
83        return $this->layoutName;
84    }
85
86    public function setLayoutName(string $layoutName): self
87    {
88        $this->layoutName = $layoutName;
89
90        return $this;
91    }
92
93    public function getSlideMaster(): SlideMaster
94    {
95        return $this->slideMaster;
96    }
97}