Skip to content

Instantly share code, notes, and snippets.

@wodCZ
Created September 4, 2015 13:05
Show Gist options
  • Save wodCZ/bc16fb698b5de1beb102 to your computer and use it in GitHub Desktop.
Save wodCZ/bc16fb698b5de1beb102 to your computer and use it in GitHub Desktop.
<?php
namespace Libs\Utils;
use Kdyby\Doctrine\EntityManager;
use Nette\DI\Container;
class EntityManagerAccessor
{
/** @var Container */
protected $container;
/**
* @param Container $container
*/
public function __construct(Container $container)
{
$this->container = $container;
}
/**
* @return EntityManager
*/
public function get()
{
return $this->container->getByType(EntityManager::class);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment