westdc-core/Westdc/EventModel/HandleFactory.php

29 lines
561 B
PHP
Raw Normal View History

<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2014/11/10
* Time: 13:36
*/
namespace Westdc\EventModel;
use Westdc\EventModel\Handles;
2014-11-14 10:02:49 +00:00
use Westdc\Service\AbstractServiceManager;
2014-11-14 10:02:49 +00:00
class HandleFactory extends AbstractServiceManager{
2014-11-14 10:02:49 +00:00
public function get($handleName)
{
2014-11-14 10:02:49 +00:00
$config = $this->getServiceManager()->get('Config');
$handleName = $config->get('application.ini')->HandlesNamespace . "\\" . $handleName;
if(class_exists($handleName))
{
return new $handleName();
}
}
}