westdc-core/Westdc/Service/ServiceManager.php

41 lines
818 B
PHP
Raw Normal View History

<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2014/11/11
* Time: 11:12
*/
namespace Westdc\Service;
use Zend\ServiceManager\ServiceManager as Zend_ServiceManager;
class ServiceManager {
private $serviceManager;
function __construct()
{
$this->serviceManager = new Zend_ServiceManager();
$this->serviceManager->addAbstractFactory(new ServiceFactory);
}
public function addKey($key,$value = "")
{
if(!empty($value))
$this->serviceManager->$key($value);
else
$this->serviceManager->$key();
}
public function setServiceManager(Zend_ServiceManager $service)
{
$this->serviceManager = $service;
}
public function getServiceManager()
{
return $this->serviceManager;
}
}