Created
September 4, 2015 13:05
-
-
Save wodCZ/bc16fb698b5de1beb102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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