-
Notifications
You must be signed in to change notification settings - Fork 144
/
AbstractMenuPageHandler.class.php
63 lines (55 loc) · 1.25 KB
/
AbstractMenuPageHandler.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace wcf\system\page\handler;
use wcf\data\menu\item\MenuItem;
/**
* Default implementation for pages supporting visibility and outstanding items.
*
* It is highly recommended to extend this class rather than implementing the interface
* directly to achieve better upwards-compatibility in case of interface changes.
*
* @author Alexander Ebert
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 3.0
*/
abstract class AbstractMenuPageHandler implements IMenuPageHandler
{
/**
* @since 6.1
*/
private MenuItem $menuItem;
/**
* @inheritDoc
*/
public function getOutstandingItemCount($objectID = null)
{
return 0;
}
/**
* @inheritDoc
*/
public function isVisible($objectID = null)
{
return true;
}
/**
* @inheritDoc
*/
public function cacheObject(int $objectID): void
{
}
/**
* @inheritDoc
*/
public function setMenuItem(MenuItem $menuItem): void
{
$this->menuItem = $menuItem;
}
/**
* @inheritDoc
*/
public function getMenuItem(): ?MenuItem
{
return $this->menuItem ?? null;
}
}