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 http://nettephp.com
- 12: *
- 18: */
- 28: /**
- 29: * Component is the base class for all components.
- 30: *
- 31: * Components are objects implementing IComponent. They has parent component,
- 32: * own name and service locator.
- 33: *
- 37: *
- 40: */
- 42: {
- 52: /** @var array of [type => [obj, depth, path, isMonitored?]] or NULL (monitored but not processed yet) */
- 57: /**
- 58: */
- 60: {
- 66: }
- 67: }
- 71: /**
- 72: * Lookup hierarchy for component specified by class or interface name.
- 76: */
- 78: {
- 91: }
- 103: }
- 106: }
- 107: }
- 111: }
- 114: }
- 118: /**
- 119: * Lookup for component specified by class or interface name. Returns backtrace path.
- 120: * A path is the concatenation of component names separated by self::NAME_SEPARATOR.
- 124: */
- 126: {
- 130: }
- 134: /**
- 135: * Starts monitoring.
- 138: */
- 140: {
- 144: }
- 148: /**
- 149: * This method will be called when the component (or component's parent)
- 150: * becomes attached to a monitored object. Do not call this method yourself.
- 153: */
- 155: {
- 156: }
- 160: /**
- 161: * This method will be called before the component (or component's parent)
- 162: * becomes detached from a monitored object. Do not call this method yourself.
- 165: */
- 167: {
- 168: }
- 172: /********************* interface IComponent ****************d*g**/
- 176: /**
- 178: */
- 180: {
- 182: }
- 186: /**
- 187: * Returns the container if any.
- 189: */
- 191: {
- 193: }
- 197: /**
- 198: * Sets the parent of this component. This method is managed by containers and should.
- 199: * not be called by applications
- 200: *
- 201: * @param IComponentContainer New parent or null if this component is being removed from a parent
- 205: */
- 207: {
- 214: }
- 216: // A component cannot be given a parent if it already has a parent.
- 219: }
- 221: // remove from parent?
- 223: // parent cannot be removed if is still this component contains
- 225: throw new InvalidStateException('The current parent still recognizes this component as its child.');
- 226: }
- 232: // Given parent container does not already recognize this component as its child.
- 234: throw new InvalidStateException('The given parent does not recognize this component as its child.');
- 235: }
- 243: }
- 244: }
- 248: /**
- 249: * Is called by a component when it is about to be set new parent. Descendant can
- 250: * override this method to disallow a parent change by throwing an \InvalidStateException
- 254: */
- 256: {
- 257: }
- 261: /**
- 262: * Refreshes monitors.
- 266: */
- 268: {
- 273: }
- 274: }
- 275: }
- 285: }
- 286: }
- 287: }
- 304: }
- 305: }
- 306: }
- 307: }
- 308: }
- 312: /**
- 313: * Sets the service location (experimental).
- 316: */
- 318: {
- 320: }
- 324: /**
- 325: * Gets the service locator (experimental).
- 327: */
- 329: {
- 334: }
- 337: }
- 341: /**
- 342: * Gets the service (experimental).
- 345: */
- 347: {
- 349: }
- 353: /********************* cloneable, serializable ****************d*g**/
- 357: /**
- 358: * Object cloning.
- 359: */
- 361: {
- 369: }
- 374: }
- 375: }
- 379: /**
- 380: * Prevents unserialization.
- 381: */
- 383: {
- 385: }
- 387: }