I want to access service container withing the entity below but how?
Checked this but I got lost when I was reading listeners;
controller
public function indexAction()
{
$orders = $this->getDoctrine()->getManager()->getRepository('MyAdminBundle:Orders')->findAll();
.....
}
entity
namespace My\AdminBundle\Entity;
class Orders
{
private $container;
public function __constructor()
{
$this->container = ??????
}
public function getCurrency()
{
return $this->container->getParameter('currency');
}
}