00001 <?php 00002 00003 /* 00004 * This file is part of the PEIP package. 00005 * (c) 2010 Timo Michna <timomichna/yahoo.de> 00006 * 00007 * For the full copyright and license information, please view the LICENSE 00008 * file that was distributed with this source code. 00009 */ 00010 00023 class PEIP_Service_Container_Builder extends PEIP_Internal_Store_Abstract{ 00024 00025 00026 00033 public function setFactory($key, PEIP_Dedicated_Factory $factory){ 00034 $this->setInternalValue($key, $factory); 00035 } 00036 00037 00043 public function getFactory($key){ 00044 $this->getInternalValue($key); 00045 } 00046 00047 00053 public function hasFactory($key){ 00054 $this->hasInternalValue($key); 00055 } 00056 00057 00063 public function deleteFactory($key){ 00064 $this->deleteInternalValue($key); 00065 } 00066 00067 00073 public function getService($key){ 00074 return isset($this->services[$key]) ? $this->services[$key] : $this->services[$key] = $this->getFactory($key)->build(); 00075 } 00076 00077 00078 00084 public function buildService($key){ 00085 return $this->getFactory($key)->build(); 00086 } 00087 00088 00089 00090 00091 00092 }