src/Support/Container/Container.php
/**
	 * Returns a collection of all service objects derived from the given class name.
	 *
	 * @param string $className
	 * @param mixed ...$args
	 * @return ServiceObjectCollection
	 */
Returns a collection of all service objects derived from the given class name.
@param string $className
@param mixed ...$args
@return ServiceObjectCollection
Returns a collection of all service objects derived from the given class name . @param string $className @param mixed ... $args @return ServiceObjectCollection
public function all($className, $args = null) {
		$args = func_get_args();
		$collection = null;
		$className = array_shift($args);
		if (array_key_exists($className, $this->providersMap)) {
			$providers = $this->providersMap[$className];
			$objects = array();
			foreach ($providers as $provider) {
				if ($provider->isDeferred() && !in_array($provider, static::$booted)) {
					$provider->boot();
				}
				foreach ($provider->resolve($className, $args) as $resolved) {
					if ($resolved instanceof $className) {
						$objects[] = $resolved;
					}
				}
			}
			$collection = new ServiceObjectCollection($objects);
		}
		if (is_null($collection)) {
			$collection = new ServiceObjectCollection();
		}
		return $collection;
	}
public function all ( $ className , $ args = null ) { $ args = func_get_args ( ) ; $ collection = null ; $ className = array_shift ( $ args ) ; if ( array_key_exists ( $ className , $ this -> providersMap ) ) { $ providers = $ this -> providersMap [ $ className ] ; $ objects = array ( ) ; foreach ( $ providers as $ provider ) { if ( $ provider -> isDeferred ( ) && ! in_array ( $ provider , static :: $ booted ) ) { $ provider -> boot ( ) ; } foreach ( $ provider -> resolve ( $ className , $ args ) as $ resolved ) { if ( $ resolved instanceof $ className ) { $ objects [ ] = $ resolved ; } } } $ collection = new ServiceObjectCollection ( $ objects ) ; } if ( is_null ( $ collection ) ) { $ collection = new ServiceObjectCollection ( ) ; } return $ collection ; }
Returns a collection of all service objects derived from the given class name.
Returns a collection of all service objects derived from the given class name .
// Resolve from service providers