Source for file ComponentContainer.php
Documentation is available at ComponentContainer.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 6: * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- 7: *
- 8: * This source file is subject to the "Nette license" that is bundled
- 9: * with this package in the file license.txt.
- 10: *
- 11: * For more information please see https://nette.org
- 12: *
- 19: */
- 29: /**
- 30: * ComponentContainer is default implementation of IComponentContainer.
- 31: *
- 35: */
- 37: {
- 46: /********************* interface IComponentContainer ****************d*g**/
- 50: /**
- 51: * Adds the specified component to the IComponentContainer.
- 57: */
- 59: {
- 62: }
- 71: throw new InvalidArgumentException("Component name must be non-empty alphanumeric string, '$name' given.");
- 72: }
- 76: }
- 78: // check circular reference
- 83: }
- 87: // user checking
- 96: }
- 100: }
- 106: }
- 107: }
- 111: /**
- 112: * Removes a component from the IComponentContainer.
- 115: */
- 117: {
- 120: throw new InvalidArgumentException("Component named '$name' is not located in this container.");
- 121: }
- 125: }
- 129: /**
- 130: * Returns component specified by name or path.
- 134: */
- 136: {
- 141: }
- 145: }
- 155: }
- 156: }
- 160: /**
- 161: * Component factory. Descendant can override this method to enable lazy component loading.
- 164: */
- 166: {
- 167: }
- 171: /**
- 172: * Iterates over a components.
- 176: */
- 178: {
- 181: $deep = $deep > 0 ? RecursiveIteratorIterator::SELF_FIRST : RecursiveIteratorIterator::CHILD_FIRST;
- 183: }
- 187: }
- 189: }
- 193: /**
- 194: * Descendant can override this method to disallow insert a child by throwing an \InvalidStateException.
- 198: */
- 200: {
- 201: }
- 205: /********************* cloneable, serializable ****************d*g**/
- 209: /**
- 210: * Object cloning.
- 211: */
- 213: {
- 219: }
- 221: }
- 223: }
- 227: /**
- 228: * Is container cloning now?
- 231: */
- 233: {
- 235: }
- 237: }
- 241: /**
- 242: * Recursive component iterator. See ComponentContainer::getComponents().
- 243: *
- 247: */
- 249: {
- 251: /**
- 252: * Has the current element has children?
- 254: */
- 256: {
- 258: }
- 262: /**
- 263: * The sub-iterator for the current element.
- 265: */
- 267: {
- 269: }
- 271: }