Source for file Component.php
Documentation is available at Component.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: * Component is the base class for all components.
- 31: *
- 32: * Components are objects implementing IComponent. They has parent component,
- 33: * own name and service locator.
- 34: *
- 38: */
- 40: {
- 50: /** @var array of [type => [obj, depth, path, isMonitored?]] or NULL (monitored but not processed yet) */
- 55: /**
- 56: */
- 58: {
- 64: }
- 65: }
- 69: /**
- 70: * Lookup hierarchy for component specified by class or interface name.
- 74: */
- 76: {
- 89: }
- 101: }
- 104: }
- 105: }
- 109: }
- 112: }
- 116: /**
- 117: * Lookup for component specified by class or interface name. Returns backtrace path.
- 118: * A path is the concatenation of component names separated by self::NAME_SEPARATOR.
- 122: */
- 124: {
- 128: }
- 132: /**
- 133: * Starts monitoring.
- 136: */
- 138: {
- 142: }
- 146: /**
- 147: * This method will be called when the component (or component's parent)
- 148: * becomes attached to a monitored object. Do not call this method yourself.
- 151: */
- 153: {
- 154: }
- 158: /**
- 159: * This method will be called before the component (or component's parent)
- 160: * becomes detached from a monitored object. Do not call this method yourself.
- 163: */
- 165: {
- 166: }
- 170: /********************* interface IComponent ****************d*g**/
- 174: /**
- 176: */
- 178: {
- 180: }
- 184: /**
- 185: * Returns the container if any.
- 187: */
- 189: {
- 191: }
- 195: /**
- 196: * Sets the parent of this component. This method is managed by containers and should.
- 197: * not be called by applications
- 198: *
- 199: * @param IComponentContainer New parent or null if this component is being removed from a parent
- 203: */
- 205: {
- 212: }
- 214: // A component cannot be given a parent if it already has a parent.
- 217: }
- 219: // remove from parent?
- 221: // parent cannot be removed if is still this component contains
- 223: throw new InvalidStateException('The current parent still recognizes this component as its child.');
- 224: }
- 230: // Given parent container does not already recognize this component as its child.
- 232: throw new InvalidStateException('The given parent does not recognize this component as its child.');
- 233: }
- 241: }
- 242: }
- 246: /**
- 247: * Is called by a component when it is about to be set new parent. Descendant can
- 248: * override this method to disallow a parent change by throwing an \InvalidStateException
- 252: */
- 254: {
- 255: }
- 259: /**
- 260: * Refreshes monitors.
- 264: */
- 266: {
- 271: }
- 272: }
- 273: }
- 283: }
- 284: }
- 285: }
- 302: }
- 303: }
- 304: }
- 305: }
- 306: }
- 310: /**
- 311: * Sets the service location (experimental).
- 314: */
- 316: {
- 318: }
- 322: /**
- 323: * Gets the service locator (experimental).
- 325: */
- 327: {
- 332: }
- 335: }
- 339: /**
- 340: * Gets the service (experimental).
- 343: */
- 345: {
- 347: }
- 351: /********************* cloneable, serializable ****************d*g**/
- 355: /**
- 356: * Object cloning.
- 357: */
- 359: {
- 367: }
- 372: }
- 373: }
- 377: /**
- 378: * Prevents unserialization.
- 379: */
- 381: {
- 383: }
- 385: }