Created
February 8, 2013 05:43
-
-
Save EuphoryX1/4736911 to your computer and use it in GitHub Desktop.
サービスを別のサービスに注入する。例ではsessionを注入している。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Euphory\Bundle\StoreBundle; | |
class ServiceWithSession | |
{ | |
private $session; | |
public function setSession($session) | |
{ | |
$this->session = $session; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service_with_session: | |
class: Euphory\Bundle\StoreBundle\ServiceWithSession | |
calls: | |
- [ setSession, [ @session ] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment