まずはservice.ymlで下記のように定義。
services:
your.service:
class: YourVendor\YourBundle\Service\YourService
arguments: [ @doctrine.orm.entity_manager ]
そしてサービスはこんな感じ。
namespace ...\Service;
use Doctrine\ORM\EntityManager;
class YourService
{
protected $em;
public function __construct(EntityManager $em)
{
$this->em = $em;
}
}
完璧だね。