カスタム アプリケーション リソースを作成しました。
class Custom_Entitymanager extends Zend_Application_Resource_ResourceAbstract{
//...
public function init (){
//...
$em = \Doctrine\ORM\EntityManager::create($options['connection'], $config);
return $em;
}
}
MyProject\library\Custom\Entitymanager.php
そしてファイルに入れました。
次を使用して取得したい場合Entitymanager
:
$em = $this->getInvokeArg('bootstrap')->getResource('entityManager');
null オブジェクトを取得します。
application.ini
カスタム アプリケーション リソースをファイルに登録するにはどうすればよいですか?