Commit | Line | Data |
---|---|---|
158bd3ca | 1 | <?php |
308c880f | 2 | declare(strict_types=1); |
158bd3ca TD |
3 | namespace wcf\system\package; |
4 | use wcf\system\form\FormDocument; | |
5 | ||
6 | /** | |
7 | * Represents step information within an installation node. | |
9f959ced | 8 | * |
158bd3ca | 9 | * @author Alexander Ebert |
c839bd49 | 10 | * @copyright 2001-2018 WoltLab GmbH |
158bd3ca | 11 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 | 12 | * @package WoltLabSuite\Core\System\Package |
158bd3ca TD |
13 | */ |
14 | class PackageInstallationStep { | |
15 | /** | |
16 | * form document object | |
4e25add7 | 17 | * @var FormDocument |
158bd3ca TD |
18 | */ |
19 | protected $document = null; | |
20 | ||
21 | /** | |
22 | * next installation node | |
158bd3ca TD |
23 | * @var string |
24 | */ | |
25 | protected $node = ''; | |
26 | ||
27 | /** | |
b1a0a33c | 28 | * indicates if current current node should be splitted |
158bd3ca TD |
29 | * @var boolean |
30 | */ | |
31 | protected $splitNode = false; | |
32 | ||
33 | /** | |
34 | * Sets next installation node. | |
9f959ced | 35 | * |
158bd3ca TD |
36 | * @param string $node |
37 | */ | |
38 | public function setNode($node) { | |
39 | $this->node = $node; | |
40 | } | |
41 | ||
42 | /** | |
43 | * Returns next installation node. | |
9f959ced | 44 | * |
158bd3ca TD |
45 | * @return string |
46 | */ | |
47 | public function getNode() { | |
48 | return $this->node; | |
49 | } | |
50 | ||
51 | /** | |
52 | * Sets form document object. | |
9f959ced | 53 | * |
158bd3ca TD |
54 | * @param FormDocument $document |
55 | */ | |
56 | public function setDocument(FormDocument $document) { | |
57 | $this->document = $document; | |
58 | } | |
59 | ||
60 | /** | |
61 | * Returns HTML-representation of form document object. | |
9f959ced | 62 | * |
158bd3ca TD |
63 | * @return string |
64 | */ | |
65 | public function getTemplate() { | |
66 | return $this->document->getHTML(); | |
67 | } | |
68 | ||
69 | /** | |
70 | * Returns true if current step holds a form document object. | |
9f959ced | 71 | * |
158bd3ca TD |
72 | * @return boolean |
73 | */ | |
74 | public function hasDocument() { | |
75 | return ($this->document !== null); | |
76 | } | |
77 | ||
78 | /** | |
79 | * Enforces node splitting. | |
80 | */ | |
81 | public function setSplitNode() { | |
82 | $this->splitNode = true; | |
83 | } | |
84 | ||
85 | /** | |
86 | * Returns true if node should be splitted. | |
9f959ced | 87 | * |
158bd3ca TD |
88 | * @return boolean |
89 | */ | |
90 | public function splitNode() { | |
91 | return $this->splitNode; | |
92 | } | |
dcb3a44c | 93 | } |