1 | <?php |
||
11 | class ServiceFromRegistryDefinition implements DumpableInterface |
||
12 | { |
||
13 | /** |
||
14 | * The identifier of the instance in the container. |
||
15 | * |
||
16 | * @var string|null |
||
17 | */ |
||
18 | private $identifier; |
||
19 | |||
20 | /** |
||
21 | * The key of the service provider in the registry |
||
22 | * @var int |
||
23 | */ |
||
24 | private $serviceProviderKey; |
||
25 | |||
26 | /** |
||
27 | * @var CallbackWrapperDefinition |
||
28 | */ |
||
29 | private $callbackWrapperDefinition; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $serviceName; |
||
35 | |||
36 | /** |
||
37 | * @param string|null $identifier |
||
38 | * @param string $serviceName |
||
39 | * @param int $serviceProviderKey |
||
40 | * @param CallbackWrapperDefinition|null $callbackWrapperDefinition |
||
41 | */ |
||
42 | public function __construct($identifier, $serviceName, $serviceProviderKey, CallbackWrapperDefinition $callbackWrapperDefinition = null) |
||
49 | |||
50 | |||
51 | /** |
||
52 | * Returns the identifier for this object in the container. |
||
53 | * If null, classes consuming this definition should assume the definition must be inlined. |
||
54 | * |
||
55 | * @return string|null |
||
56 | */ |
||
57 | public function getIdentifier() |
||
61 | |||
62 | /** |
||
63 | * @return int |
||
64 | */ |
||
65 | public function getServiceProviderKey() |
||
69 | |||
70 | /** |
||
71 | * @return CallbackWrapperDefinition |
||
72 | */ |
||
73 | public function getCallbackWrapperDefinition() |
||
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getServiceName() |
||
85 | |||
86 | /** |
||
87 | * Returns an InlineEntryInterface object representing the PHP code necessary to generate |
||
88 | * the container entry. |
||
89 | * |
||
90 | * @param string $containerVariable The name of the variable that allows access to the container instance. For instance: "$container", or "$this->container" |
||
91 | * @param array $usedVariables An array of variables that are already used and that should not be used when generating this code. |
||
92 | * |
||
93 | * @return InlineEntryInterface |
||
94 | */ |
||
95 | public function toPhpCode($containerVariable, array $usedVariables = array()) |
||
105 | } |
||
106 |