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: {
- 149: }
- 152: throw new InvalidArgumentException("Component or subcomponent name must not be empty string.");
- 153: }
- 154: }
- 158: }
- 168: throw new InvalidArgumentException("Component with name '$name' is not container and cannot have '$ext' component.");
- 169: }
- 173: }
- 174: }
- 178: /**
- 179: * Component factory. Delegates the creation of components to a createComponent<Name> method.
- 182: */
- 184: {
- 187: if ($ucname !== $name && method_exists($this, $method) && $this->getReflection()->getMethod($method)->getName() === $method) {
- 191: }
- 192: }
- 193: }
- 197: /**
- 198: * Iterates over a components.
- 202: */
- 204: {
- 207: $deep = $deep > 0 ? RecursiveIteratorIterator::SELF_FIRST : RecursiveIteratorIterator::CHILD_FIRST;
- 209: }
- 213: }
- 215: }
- 219: /**
- 220: * Descendant can override this method to disallow insert a child by throwing an \InvalidStateException.
- 224: */
- 226: {
- 227: }
- 231: /********************* cloneable, serializable ****************d*g**/
- 235: /**
- 236: * Object cloning.
- 237: */
- 239: {
- 245: }
- 247: }
- 249: }
- 253: /**
- 254: * Is container cloning now?
- 257: */
- 259: {
- 261: }
- 263: }
- 267: /**
- 268: * Recursive component iterator. See ComponentContainer::getComponents().
- 269: *
- 273: */
- 275: {
- 277: /**
- 278: * Has the current element has children?
- 280: */
- 282: {
- 284: }
- 288: /**
- 289: * The sub-iterator for the current element.
- 291: */
- 293: {
- 295: }
- 299: /**
- 300: * Returns the count of elements.
- 302: */
- 304: {
- 306: }
- 308: }