php - Is it possible to inject a method into a service in symfony services.yml -
there plenty of documentation on internet injecting service service this: http://symfony.com/doc/current/components/dependency_injection/introduction.html however, have service called objectcache configured in symfony's services.yml this: object_cache: class: app\bundle\apibundle\service\objectcache this service has 2 methods getting , setting user object. example: $user = new user(); // assume entity database $this->get('object_cache')->setuser($user); // ... $this->get('object_cache')->getuser(); // instance of $user i want create new service depends on user, makes sense inject user @ service creation: class someservice { public function __construct(user $user) { } } how configure services.yml such user injected new service? object_cache: class: app\bundle\apibundle\service\objectcache some_service: class: app\bundle\apibundle\service\someservice arguments: [@object_cache->getuser()????] this didn't wor...