facilitatech/service-locator-factory
Composer 安装命令:
composer require facilitatech/service-locator-factory
包简介
Get the service locator in Laminas
README 文档
README
Allow you to get ServiceManager from everywhere in your application by calling this static factory.
<?php
namespace Corp\News;
use Corp\News\NewsDAO;
use Zend\ServiceManager\ServiceManager;
use Corp\ServiceLocator\ServiceLocator;
class NewsDAOFactory
{
private function __construct()
{
}
/**
* @return \Corp\News\NewsDAO
*/
public static function getInstance()
{
$sm = ServiceLocatorFactory::getInstance();
$em = $sm->get('doctrine.entitymanager.orm_default');
return new NewsDAO($em);
}
}
统计信息
- 总下载量: 1.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-24