Skip to content

Instantly share code, notes, and snippets.

@ajohnstone
Created February 27, 2013 17:21
Show Gist options
  • Save ajohnstone/5049724 to your computer and use it in GitHub Desktop.
Save ajohnstone/5049724 to your computer and use it in GitHub Desktop.
services:
ia.rest.client:
class: IA\WebBundle\Models\RestClient
public: true
ia.model.babel.member:
class: IA\WebBundle\Models\Babel\Member
public: true
calls:
- [ setRestClient, [ @ia.rest.client ] ]
- [ setContainer, [ @service_container ] ] # Works
# - [ setSession, [ @session ] ] # DOes not
<?php
namespace IA\WebBundle\Models;
use IA;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class AbstractModel
public function setContainer(ContainerInterface $c) {
var_dump($c->get('session'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment