tecbot/AMFBundle-sandbox — Issue #3: How can I use my other Container Services inside an AMF Service
Author: leonardorcortes
Created: 2012-02-29 14:33:15+00:00
State: open

I'm trying to do this but without success, can you help me?

Example:

My\ExampleBundle\Amf\ExampleAmfService.php

```php
namespace My\ExampleBundle\Amf;

class ExampleAmfService
{

public function listAction()
{
$list = $this->get('my.example_bundle.example_service')->listAll();
return $list;
}

}
```

My\ExampleBundle\Service\ExampleService.php

```php
namespace My\ExampleBundle\Service;

class ExampleService
{

private $entityManager;

public function getEntityManager()
{
return $this->entityManager;
}

public function setEntityManager($entityManager)
{
$this->entityManager = $entityManager;
}

public function listAll()
{
return $this->getEntityManager()->getRepository('My\ExampleBundle\Entity\Example')->findAll();
}

}
```

My\ExampleBundle\Resources\config\services.xml
--------------------------------------------------------------------

```xml

```