| 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 |
declare (strict_types=1); |
| 8 |
namespace Packetery\Nette\ComponentModel; |
| 9 |
|
| 10 |
use Packetery\Nette; |
| 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 |
* @return static |
| 19 |
*/ |
| 20 |
function addComponent(IComponent $component, ?string $name); |
| 21 |
/** |
| 22 |
* Removes the component from the container. |
| 23 |
*/ |
| 24 |
function removeComponent(IComponent $component) : void; |
| 25 |
/** |
| 26 |
* Returns component specified by name or path. |
| 27 |
* @throws \Packetery\Nette\InvalidArgumentException if component doesn't exist |
| 28 |
*/ |
| 29 |
function getComponent(string $name) : ?IComponent; |
| 30 |
/** |
| 31 |
* Iterates over descendants components. |
| 32 |
* @return \Iterator<int|string,IComponent> |
| 33 |
*/ |
| 34 |
function getComponents() : \Iterator; |
| 35 |
} |
| 36 |
|