1 | <?php |
||
20 | class ServiceIdBuilder |
||
21 | { |
||
22 | // bundle ID (underscored string) |
||
23 | protected $bundleId; |
||
24 | // ConfigCache service ID prefix |
||
25 | protected $prefix = 'config'; |
||
26 | |||
27 | /** |
||
28 | * Builds a cache service ID. |
||
29 | * |
||
30 | * @param array $suffixes ex) array("yahoo_japan_config_cache") |
||
31 | * |
||
32 | * @return string ex) "config.yahoo_japan_config_cache" |
||
33 | */ |
||
34 | 29 | public function buildId(array $suffixes) |
|
38 | |||
39 | /** |
||
40 | * Builds a cache service ID with bundleId. |
||
41 | * |
||
42 | * @param array $suffixes ex) $suffixes = array("suffix"), $this->bundleId = "yahoo_japan_config_cache" |
||
43 | * |
||
44 | * @return string ex) "config.yahoo_japan_config_cache.suffix" |
||
45 | */ |
||
46 | 24 | public function buildCacheId(array $suffixes = array()) |
|
50 | |||
51 | /** |
||
52 | * Builds a configuration private service ID. |
||
53 | * |
||
54 | * @param ConfigurationInterface $configuration |
||
55 | * |
||
56 | * @return string |
||
57 | * |
||
58 | * @note before : Acme\DemoBundle\DependencyInjection\Configuration |
||
59 | * after : acme.demo_bundle.dependency_injection.configuration |
||
60 | */ |
||
61 | 20 | public function buildConfigurationId(ConfigurationInterface $configuration) |
|
68 | |||
69 | /** |
||
70 | * Gets a bundleId. |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | 26 | public function getBundleId() |
|
78 | |||
79 | /** |
||
80 | * Sets a bundleId. |
||
81 | * |
||
82 | * @param string $bundleId |
||
83 | * |
||
84 | * @return ServiceIdBuilder |
||
85 | */ |
||
86 | 34 | public function setBundleId($bundleId) |
|
92 | |||
93 | /** |
||
94 | * Gets a prefix. |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | 25 | public function getPrefix() |
|
102 | |||
103 | /** |
||
104 | * Sets a prefix. |
||
105 | * |
||
106 | * @param string $prefix |
||
107 | * |
||
108 | * @return ServiceIdBuilder |
||
109 | */ |
||
110 | 1 | public function setPrefix($prefix) |
|
111 | { |
||
112 | 1 | $this->prefix = $prefix; |
|
113 | |||
114 | 1 | return $this; |
|
115 | } |
||
116 | |||
117 | /** |
||
118 | * Parses a service ID based on bundle name. |
||
119 | * |
||
120 | * @param string $name |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | 14 | public static function parseServiceId($name) |
|
128 | } |
||
129 |