1: <?php
2:
3: namespace Charcoal\Ui\MenuItem;
4:
5: /**
6: * Defines a menu item.
7: */
8: interface MenuItemInterface
9: {
10: /**
11: * @param string $ident The menu item identifier.
12: * @return MenuItemInterface Chainable
13: */
14: public function setIdent($ident);
15:
16: /**
17: * @return string
18: */
19: public function ident();
20:
21: /**
22: * @param string $label The menu item label.
23: * @return MenuItemInterface Chainable
24: */
25: public function setLabel($label);
26:
27: /**
28: * @return string
29: */
30: public function label();
31:
32: /**
33: * @param string $url The menu item URL.
34: * @return MenuItemInterface Chainable
35: */
36: public function setUrl($url);
37:
38: /**
39: * @return string
40: */
41: public function url();
42:
43: /**
44: * @return boolean
45: */
46: public function hasUrl();
47:
48: /**
49: * @param array $children The menu item children menu structure.
50: * @return MenuItemInterface Chainable
51: */
52: public function setChildren(array $children);
53:
54: /**
55: * @param array|MenuItemInterface $child The child object or structure.
56: * @return MenuItemInterface Chainable
57: */
58: public function addChild($child);
59:
60: /**
61: * @return MenuItemInterface[]
62: */
63: public function children();
64:
65: /**
66: * @return boolean
67: */
68: public function hasChildren();
69:
70: /**
71: * @return integer
72: */
73: public function numChildren();
74: }
75: