Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dynamic settings injection 3/4, as of eZ 5.4 / 2014.09 - Constructor injection
parameters:
acme_test.my_service.class: Acme\TestBundle\MyServiceClass
services:
acme_test.my_service:
class: %acme_test.my_service.class%
arguments: ["$languages$", "$content.tree_root.location_id$"]
<?php
namespace Acme\TestBundle;
class MyServiceClass
{
/**
* Prioritized languages
*
* @var array
*/
private $languages;
/**
* @var int
*/
private $rootLocationId;
public function __construct( array $languages, $rootLocationId )
{
$this->languages = $languages;
$this->rootLocationId = $rootLocationId
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.