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 http://nettephp.com
- 12: *
- 18: */
- 28: /**
- 29: * ComponentContainer is default implementation of IComponentContainer.
- 30: *
- 34: *
- 36: */
- 38: {
- 47: /********************* interface IComponentContainer ****************d*g**/
- 51: /**
- 52: * Adds the specified component to the IComponentContainer.
- 58: */
- 60: {
- 63: }
- 72: throw new InvalidArgumentException("Component name must be non-empty alphanumeric string, '$name' given.");
- 73: }
- 77: }
- 79: // check circular reference
- 84: }
- 88: // user checking
- 97: }
- 101: }
- 107: }
- 108: }
- 112: /**
- 113: * Removes a component from the IComponentContainer.
- 116: */
- 118: {
- 121: throw new InvalidArgumentException("Component named '$name' is not located in this container.");
- 122: }
- 126: }
- 130: /**
- 131: * Returns component specified by name or path.
- 135: */
- 137: {
- 142: }
- 145: throw new InvalidArgumentException("Component or subcomponent name must be non-empty alphanumeric string, '$name' given.");
- 146: }
- 150: }
- 153: return $a === FALSE ? $this->components[$name] : $this->components[$name]->getComponent($ext, $need);
- 160: }
- 161: }
- 165: /**
- 166: * Component factory. Descendant can override this method to enable lazy component loading.
- 169: */
- 171: {
- 172: }
- 176: /**
- 177: * Iterates over a components.
- 181: */
- 183: {
- 186: $deep = $deep > 0 ? RecursiveIteratorIterator::SELF_FIRST : RecursiveIteratorIterator::CHILD_FIRST;
- 188: }
- 192: }
- 194: }
- 198: /**
- 199: * Descendant can override this method to disallow insert a child by throwing an \InvalidStateException.
- 203: */
- 205: {
- 206: }
- 210: /********************* cloneable, serializable ****************d*g**/
- 214: /**
- 215: * Object cloning.
- 216: */
- 218: {
- 224: }
- 226: }
- 228: }
- 232: /**
- 233: * Is container cloning now?
- 236: */
- 238: {
- 240: }
- 242: }
- 246: /**
- 247: * Recursive component iterator. See ComponentContainer::getComponents().
- 248: *
- 252: */
- 254: {
- 256: /**
- 257: * Has the current element has children?
- 259: */
- 261: {
- 263: }
- 267: /**
- 268: * The sub-iterator for the current element.
- 270: */
- 272: {
- 274: }
- 276: }