1 | <?php |
||
33 | abstract class DataFixture extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface |
||
34 | { |
||
35 | /** |
||
36 | * Container. |
||
37 | * |
||
38 | * @var ContainerInterface |
||
39 | */ |
||
40 | protected $container; |
||
41 | |||
42 | /** |
||
43 | * Alias to default language faker. |
||
44 | * |
||
45 | * @var Generator |
||
46 | */ |
||
47 | protected $faker; |
||
48 | |||
49 | /** |
||
50 | * Faker. |
||
51 | * |
||
52 | * @var Generator |
||
53 | */ |
||
54 | protected $fakers; |
||
55 | |||
56 | /** |
||
57 | * Default locale. |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | protected $defaultLocale; |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function setContainer(ContainerInterface $container = null) |
||
78 | |||
79 | public function __call($method, $arguments) |
||
95 | |||
96 | /** |
||
97 | * @return VariantGenerator |
||
98 | */ |
||
99 | protected function getVariantGenerator() |
||
103 | |||
104 | /** |
||
105 | * Get zone reference by its code. |
||
106 | * |
||
107 | * @param string $code |
||
108 | * |
||
109 | * @return ZoneInterface |
||
110 | */ |
||
111 | protected function getZoneByCode($code) |
||
115 | |||
116 | /** |
||
117 | * Dispatch an event. |
||
118 | * |
||
119 | * @param string $name |
||
120 | * @param object $object |
||
121 | */ |
||
122 | protected function dispatchEvent($name, $object) |
||
126 | |||
127 | /** |
||
128 | * Get service by id. |
||
129 | * |
||
130 | * @param string $id |
||
131 | * |
||
132 | * @return object |
||
133 | */ |
||
134 | protected function get($id) |
||
138 | |||
139 | /** |
||
140 | * @return AddressInterface |
||
141 | */ |
||
142 | protected function createAddress() |
||
167 | } |
||
168 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: