Development

Changeset 19584

You must first sign up to be able to contribute.

Changeset 19584

Show
Ignore:
Timestamp:
06/26/09 10:21:54 (8 months ago)
Author:
fabien
Message:

[dependency_injection] added some more PHPDoc to explain rules of inheritance in the loaders

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • components/dependency_injection/trunk/lib/sfServiceContainerLoader.php

    r16840 r19584  
    3333 
    3434  /** 
     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  /** 
    3545   * 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. 
    3664   * 
    3765   * @param mixed $resource The resource path 
     
    5987   * Loads a resource. 
    6088   * 
     89   * Concrete classes implements this method to convert 
     90   * the resource to an array of definitions and parameters. 
     91   * 
    6192   * @param  mixed $resource The resource path 
    6293   * 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.