1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Nette\ComponentModel;
9:
10:
11: /**
12: * Containers are objects that logically contain zero or more IComponent components.
13: */
14: interface IContainer extends IComponent
15: {
16: /**
17: * Adds the component to the container.
18: * @param string|int|null $name
19: * @return static
20: */
21: function addComponent(IComponent $component, $name);
22:
23: /**
24: * Removes the component from the container.
25: * @return void
26: */
27: function removeComponent(IComponent $component);
28:
29: /**
30: * Returns component specified by name or path.
31: * @param string|int $name
32: * @return IComponent|null
33: */
34: function getComponent($name);
35:
36: /**
37: * Iterates over descendants components.
38: * @return \Iterator
39: */
40: function getComponents();
41: }
42: