Last active
August 29, 2015 14:07
-
-
Save lolautruche/cec1adb1da355ea4bde5 to your computer and use it in GitHub Desktop.
Dynamic settings injection 2/4, as eZ 5.4 / 2014.09 - Setter injection
This file contains 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
parameters: | |
acme_test.my_service.class: Acme\TestBundle\MyServiceClass | |
services: | |
acme_test.my_service: | |
class: %acme_test.my_service.class% | |
calls: | |
# Will resolve ezsettings.<current_siteaccess>.languages | |
- [setLanguages, ["$languages$"]] | |
- [setRootLocationId, ["$content.tree_root.location_id$"]] |
This file contains 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 Acme\TestBundle; | |
class MyServiceClass | |
{ | |
/** | |
* Prioritized languages | |
* | |
* @var array | |
*/ | |
private $languages; | |
/** | |
* @var int | |
*/ | |
private $rootLocationId; | |
public function setLanguages( array $languages = null ) | |
{ | |
$this->languages = $languages; | |
} | |
public function setRootLocationId( $rootLocationId = null ) | |
{ | |
$this->rootLocationId = $rootLocationId; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment