File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,14 @@ private function generateFactory(array $tableList) : void
313
313
*/
314
314
class $ daoFactoryClassName
315
315
{
316
+ private \$container;
317
+
318
+ public function __construct(ContainerInterface \$container)
319
+ {
320
+ \$this->container = \$container;
321
+ }
322
+
323
+
316
324
" ;
317
325
318
326
foreach ($ tableList as $ table ) {
@@ -332,11 +340,15 @@ class $daoFactoryClassName
332
340
*/
333
341
public function get ' .$ daoClassName .'() : ' .$ daoClassName .'
334
342
{
343
+ if (!$this-> ' .$ daoInstanceName .') {
344
+ $this-> ' .$ daoInstanceName .' = $this->container->get( ' .$ daoClassName .'::class);
345
+ }
346
+
335
347
return $this-> ' .$ daoInstanceName .';
336
348
}
337
349
338
350
/**
339
- * Sets the instance of the ' .$ daoClassName .' class that will be returned by the factory getter.
351
+ * Override the instance of the ' .$ daoClassName .' class that will be returned by the factory getter.
340
352
*
341
353
* @param ' .$ daoClassName .' $ ' .$ daoInstanceName .'
342
354
*/
You can’t perform that action at this time.
0 commit comments