Changeset 19584
- Timestamp:
- 06/26/09 10:21:54 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
components/dependency_injection/trunk/lib/sfServiceContainerLoader.php
r16840 r19584 33 33 34 34 /** 35 * Sets the service container attached to this loader. 36 * 37 * @param sfServiceContainerBuilder $container A sfServiceContainerBuilder instance 38 */ 39 public function setServiceContainer(sfServiceContainerBuilder $container) 40 { 41 $this->container = $container; 42 } 43 44 /** 35 45 * Loads a resource. 46 * 47 * A resource can be anything that can be converted to an array of 48 * definitions and parameters by the doLoad() method. 49 * 50 * Service definitions overrides the current defined ones. 51 * 52 * But for parameters, they are overriden by the current ones. It allows 53 * the parameters passed to the container constructor to have precedence 54 * over the loaderd ones. 55 * 56 * $container = new sfServiceContainerBuilder(array('foo' => 'bar')); 57 * $loader = new sfServiceContainerLoaderXXX($container); 58 * $loader->load('resource_name'); 59 * $container->register('foo', new stdClass()); 60 * 61 * In the above example, even if the loaded resource defines a foo 62 * parameter, the value will still be 'bar' as defined in the builder 63 * constructor. 36 64 * 37 65 * @param mixed $resource The resource path … … 59 87 * Loads a resource. 60 88 * 89 * Concrete classes implements this method to convert 90 * the resource to an array of definitions and parameters. 91 * 61 92 * @param mixed $resource The resource path 62 93 *

