Changeset 1748
- Timestamp:
- 07/29/08 14:00:10 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework/trunk/src/main/php/net/stubbles/ioc/stubConstantBinding.php
r1371 r1748 8 8 */ 9 9 stubClassLoader::load('net::stubbles::ioc::stubBinding', 10 'net::stubbles::ioc::stub ValueInjectionProvider'10 'net::stubbles::ioc::stubInjectionProvider' 11 11 ); 12 12 /** … … 16 16 * @subpackage ioc 17 17 */ 18 class stubConstantBinding extends stubBaseObject implements stubBinding 18 class stubConstantBinding extends stubBaseObject implements stubBinding, stubInjectionProvider 19 19 { 20 20 /** … … 29 29 protected $name = null; 30 30 /** 31 * provider that holds the binded value31 * value to provide 32 32 * 33 * @var stubValueInjectionProvider33 * @var mixed 34 34 */ 35 protected $valueProvider; 36 37 /** 38 * constructor 39 */ 40 public function __construct() 41 { 42 $this->valueProvider = new stubValueInjectionProvider(); 43 } 35 protected $value; 44 36 45 37 /** … … 51 43 public function to($value) 52 44 { 53 $this->value Provider->setValue($value);45 $this->value = $value; 54 46 return $this; 55 47 } … … 74 66 public function getProvider() 75 67 { 76 return $this ->valueProvider;68 return $this; 77 69 } 78 70 … … 86 78 return self::TYPE . '#' . $this->name; 87 79 } 80 81 /** 82 * returns the value to provide 83 * 84 * @param string $type 85 * @param string $name 86 * @return mixed 87 */ 88 public function get($type, $name = null) 89 { 90 return $this->value; 91 } 88 92 } 89 93 ?>
