Apply PSR-12 code style (#3886)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / box / IBoxController.class.php
CommitLineData
413fd5a3 1<?php
a9229942 2
413fd5a3 3namespace wcf\system\box;
a9229942 4
413fd5a3 5use wcf\data\box\Box;
bea46aa1 6use wcf\data\media\ViewableMedia;
413fd5a3
MW
7
8/**
9 * Default interface for box controllers.
a9229942
TD
10 *
11 * @author Marcel Werk
12 * @copyright 2001-2019 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\Box
15 * @since 3.0
413fd5a3 16 */
a9229942
TD
17interface IBoxController
18{
19 /**
20 * Returns the content of this box.
21 *
22 * @return string
23 */
24 public function getContent();
25
26 /**
27 * Returns false if this box has no content.
28 *
29 * @return bool
30 */
31 public function hasContent();
32
33 /**
34 * Returns the image of this box or `null` if the box has no image.
35 *
36 * Note: The box itself checks if the active user can access the returned media file.
37 *
38 * @return ViewableMedia|null
39 */
40 public function getImage();
41
42 /**
43 * Returns the title link of this box.
44 *
45 * @return string
46 */
47 public function getLink();
48
49 /**
50 * Returns true if this box has a title link.
51 *
52 * @return bool
53 */
54 public function hasLink();
55
56 /**
57 * Returns the database object of this box.
58 *
59 * @return Box
60 */
61 public function getBox();
62
63 /**
64 * Sets the database object of this box.
65 *
66 * @param Box $box
67 */
68 public function setBox(Box $box);
69
70 /**
71 * Saves additional box data for box set via `setBox()`.
72 */
73 public function saveAdditionalData();
74
75 /**
76 * Returns the title of this box, the special value `null` can be returned to
77 * apply the default behavior as seen in previous versions. Only supported for
78 * system-type boxes.
79 *
80 * @return string|null
81 * @since 5.2
82 */
83 public function getTitle();
84
85 /**
86 * Returns a list of supported box positions.
87 *
88 * @return string[]
89 */
90 public static function getSupportedPositions();
4cbb9710 91}