Source for file ComponentContainer.php
Documentation is available at ComponentContainer.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 11: */
- 15: /**
- 16: * ComponentContainer is default implementation of IComponentContainer.
- 17: *
- 20: *
- 22: */
- 24: {
- 33: /********************* interface IComponentContainer ****************d*g**/
- 37: /**
- 38: * Adds the specified component to the IComponentContainer.
- 44: */
- 46: {
- 49: }
- 58: throw new InvalidArgumentException("Component name must be non-empty alphanumeric string, '$name' given.");
- 59: }
- 63: }
- 65: // check circular reference
- 70: }
- 74: // user checking
- 83: }
- 87: }
- 93: }
- 94: }
- 98: /**
- 99: * Removes a component from the IComponentContainer.
- 102: */
- 104: {
- 107: throw new InvalidArgumentException("Component named '$name' is not located in this container.");
- 108: }
- 112: }
- 116: /**
- 117: * Returns component specified by name or path.
- 121: */
- 123: {
- 135: }
- 138: throw new InvalidArgumentException("Component or subcomponent name must not be empty string.");
- 139: }
- 140: }
- 146: }
- 147: }
- 157: throw new InvalidArgumentException("Component with name '$name' is not container and cannot have '$ext' component.");
- 158: }
- 162: }
- 163: }
- 167: /**
- 168: * Component factory. Delegates the creation of components to a createComponent<Name> method.
- 171: */
- 173: {
- 176: if ($ucname !== $name && method_exists($this, $method) && $this->getReflection()->getMethod($method)->getName() === $method) {
- 178: }
- 179: }
- 183: /**
- 184: * Iterates over a components.
- 188: */
- 190: {
- 193: $deep = $deep > 0 ? RecursiveIteratorIterator::SELF_FIRST : RecursiveIteratorIterator::CHILD_FIRST;
- 195: }
- 199: }
- 201: }
- 205: /**
- 206: * Descendant can override this method to disallow insert a child by throwing an \InvalidStateException.
- 210: */
- 212: {
- 213: }
- 217: /********************* cloneable, serializable ****************d*g**/
- 221: /**
- 222: * Object cloning.
- 223: */
- 225: {
- 231: }
- 233: }
- 235: }
- 239: /**
- 240: * Is container cloning now?
- 243: */
- 245: {
- 247: }
- 249: }
- 253: /**
- 254: * Recursive component iterator. See ComponentContainer::getComponents().
- 255: *
- 258: */
- 260: {
- 262: /**
- 263: * Has the current element has children?
- 265: */
- 267: {
- 269: }
- 273: /**
- 274: * The sub-iterator for the current element.
- 276: */
- 278: {
- 280: }
- 284: /**
- 285: * Returns the count of elements.
- 287: */
- 289: {
- 291: }
- 293: }