ModuleOptions::hasHandlerRegistry()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/jms-serializer-module
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\JmsSerializerModule\Options;
7
8
use Zend\Stdlib\AbstractOptions;
9
use Nnx\ModuleOptions\ModuleOptionsInterface;
10
11
12
/**
13
 * Class ModuleOptions
14
 *
15
 * @package Nnx\JmsSerializerModule\Options
16
 */
17
class ModuleOptions extends AbstractOptions implements ModuleOptionsInterface
18
{
19
    /**
20
     * Данные для конфига сериалайзеров
21
     *
22
     * @var array
23
     */
24
    protected $serializers = [];
25
26
    /**
27
     * Конфиги сериалайзеров
28
     *
29
     * @var SerializerPluginOptions[]
30
     */
31
    protected $serializersOptions = [];
32
33
    /**
34
     * Данные для фабрик метеданных сериалайзеров
35
     *
36
     * @var array
37
     */
38
    protected $metadataFactories = [];
39
40
    /**
41
     * Конфиги для фабрик метаданных
42
     *
43
     * @var MetadataFactoryPluginOptions[]
44
     */
45
    protected $metadataFactoriesOptions = [];
46
47
    /**
48
     * Данные для хранилища хенделеров сериалайзера
49
     *
50
     * @var array
51
     */
52
    protected $handlerRegistries = [];
53
54
    /**
55
     * Хранилища хенделеров сериалайзера
56
     *
57
     * @var PluginOptions[]
58
     */
59
    protected $handlerRegistriesOptions = [];
60
61
    /**
62
     * Данные описывающие драйверы метаданных
63
     *
64
     * @var array
65
     */
66
    protected $metadataDrivers = [];
67
68
    /**
69
     * Конфиги драйверов метаданных
70
     *
71
     * @var PluginOptions[]
72
     */
73
    protected $metadataDriversOptions = [];
74
75
    /**
76
     * Данные описывающие конструкторы объектов
77
     *
78
     * @var array
79
     */
80
    protected $objectConstructors = [];
81
82
    /**
83
     * Конфиги конструкторов объектов
84
     *
85
     * @var PluginOptions[]
86
     */
87
    protected $objectConstructorsOptions = [];
88
89
    /**
90
     * Набор плагинов используемх для сериализации
91
     *
92
     * @var array
93
     */
94
    protected $serializationVisitors = [];
95
96
    /**
97
     * Набор плагинов используемх для десериализации
98
     *
99
     * @var array
100
     */
101
    protected $deserializationVisitors = [];
102
103
    /**
104
     * Набор данных описывающих диспетчеры событий
105
     *
106
     * @var array
107
     */
108
    protected $eventDispatchers = [];
109
110
    /**
111
     * Устанавливает конфиги описывающие диспетчеры событий
112
     *
113
     * @var array
114
     */
115
    protected $eventDispatchersOptions = [];
116
117
    /**
118
     * Имя сервиса для получения кеша доктрины
119
     *
120
     * @var string
121
     */
122
    protected $annotationCache;
123
124
    /**
125
     * Данные описывающие FileLocator используемые в драйверах метаданных
126
     *
127
     * @var array
128
     */
129
    protected $fileLocators = [];
130
131
    /**
132
     * Конфиги описывающие FileLocator используемые в драйверах метаданных
133
     *
134
     * @var PluginOptions[]
135
     */
136
    protected $fileLocatorsOptions = [];
137
138
    /**
139
     * Данные описывающие Visitor'ы
140
     *
141
     * @var array
142
     */
143
    protected $visitors = [];
144
145
    /**
146
     * Конфиги описывающие Visitor'ы
147
     *
148
     * @var PluginOptions[]
149
     */
150
    protected $visitorsOptions = [];
151
152
    /**
153
     * Настройки стратегий для работы с именами свойств объектов
154
     *
155
     * @var array
156
     */
157
    protected $namingStrategies = [];
158
159
    /**
160
     * Конфиги стратегий для работы с именами свойств объектов
161
     *
162
     * @var PluginOptions[]
163
     */
164
    protected $namingStrategiesOptions = [];
165
166
    /**
167
     * Контейнер для получения сущностей
168
     *
169
     * @var string
170
     */
171
    protected $entityLocator;
172
173
    /**
174
     * Устанавливает информацию о сериалайзерах
175
     *
176
     * @param array $serializer
177
     *
178
     * @return $this
179
     */
180
    public function setSerializers(array $serializer)
181
    {
182
        $this->serializers = $serializer;
183
        $this->serializersOptions = [];
184
185
        return $this;
186
    }
187
188
    /**
189
     * Определяет есть ли сериалайзер с заданным именем
190
     *
191
     * @param string $serializerName
192
     *
193
     * @return boolean
194
     */
195
    public function hasSerializer($serializerName)
196
    {
197
        return array_key_exists($serializerName, $this->serializers);
198
    }
199
200
    /**
201
     * Возвращает конфиг сериалайзера с заданным именем
202
     *
203
     * @param $serializerName
204
     *
205
     * @return SerializerPluginOptions
206
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
207
     */
208
    public function getSerializer($serializerName)
209
    {
210
        if (array_key_exists($serializerName, $this->serializersOptions)) {
211
            return $this->serializersOptions[$serializerName];
212
        }
213
214
        if (!$this->hasSerializer($serializerName)) {
215
            $errMsg = sprintf('Config for serializer %s not found', $serializerName);
216
            throw new Exception\InvalidArgumentException($errMsg);
217
        }
218
219
        $this->serializersOptions[$serializerName] = new SerializerPluginOptions($this->serializers[$serializerName]);
220
221
        return $this->serializersOptions[$serializerName];
222
    }
223
224
    /**
225
     * Устанавливает данные для фабрик метеданных сериалайзеров
226
     *
227
     * @param array $metadataFactories
228
     *
229
     * @return $this
230
     */
231
    public function setMetadataFactories(array $metadataFactories)
232
    {
233
        $this->metadataFactories = $metadataFactories;
234
        $this->metadataFactoriesOptions = [];
235
236
        return $this;
237
    }
238
239
240
    /**
241
     * Определяет есть ли фабрика метаданных с заданныим именем
242
     *
243
     * @param string $metadataFactoryName
244
     *
245
     * @return boolean
246
     */
247
    public function hasMetadataFactory($metadataFactoryName)
248
    {
249
        return array_key_exists($metadataFactoryName, $this->metadataFactories);
250
    }
251
252
    /**
253
     * Возвращает конфиг фабрики метаданных с заданным именем
254
     *
255
     * @param $metadataFactoryName
256
     *
257
     * @return MetadataFactoryPluginOptions
258
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
259
     */
260
    public function gasMetadataFactory($metadataFactoryName)
261
    {
262
        if (array_key_exists($metadataFactoryName, $this->metadataFactoriesOptions)) {
263
            return $this->metadataFactoriesOptions[$metadataFactoryName];
264
        }
265
266
        if (!$this->hasMetadataFactory($metadataFactoryName)) {
267
            $errMsg = sprintf('Config for metadata factory %s not found', $metadataFactoryName);
268
            throw new Exception\InvalidArgumentException($errMsg);
269
        }
270
271
        $this->metadataFactoriesOptions[$metadataFactoryName] = new MetadataFactoryPluginOptions($this->metadataFactories[$metadataFactoryName]);
272
273
        return $this->metadataFactoriesOptions[$metadataFactoryName];
274
    }
275
276
    /**
277
     * Устанавливает данные для хранилища хенделеров сериалайзера
278
     *
279
     * @param array $handlerRegistries
280
     *
281
     * @return $this
282
     */
283
    public function setHandlerRegistries(array $handlerRegistries)
284
    {
285
        $this->handlerRegistries = $handlerRegistries;
286
        $this->handlerRegistriesOptions = [];
287
288
        return $this;
289
    }
290
291
    /**
292
     * Определяет есть ли хранилище хенделеров сериалайзера с заданныим именем
293
     *
294
     * @param string $handlerRegistryName
295
     *
296
     * @return boolean
297
     */
298
    public function hasHandlerRegistry($handlerRegistryName)
299
    {
300
        return array_key_exists($handlerRegistryName, $this->handlerRegistries);
301
    }
302
303
    /**
304
     * Возвращает конфиг хранилища хенделеров сериалайзера с заданныим именем
305
     *
306
     * @param $handlerRegistryName
307
     *
308
     * @return PluginOptions
309
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
310
     */
311 View Code Duplication
    public function getHandlerRegistry($handlerRegistryName)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
312
    {
313
        if (array_key_exists($handlerRegistryName, $this->handlerRegistriesOptions)) {
314
            return $this->handlerRegistriesOptions[$handlerRegistryName];
315
        }
316
317
        if (!$this->hasHandlerRegistry($handlerRegistryName)) {
318
            $errMsg = sprintf('Handler registry %s not found', $handlerRegistryName);
319
            throw new Exception\InvalidArgumentException($errMsg);
320
        }
321
322
        $this->handlerRegistriesOptions[$handlerRegistryName] = new PluginOptions($this->handlerRegistries[$handlerRegistryName]);
323
324
        return $this->handlerRegistriesOptions[$handlerRegistryName];
325
    }
326
327
    /**
328
     * Устанавливает данные описывающие драйверы метаданных
329
     *
330
     * @param array $metadataDrivers
331
     *
332
     * @return $this
333
     */
334
    public function setMetadataDrivers(array $metadataDrivers)
335
    {
336
        $this->metadataDrivers = $metadataDrivers;
337
        $this->metadataDriversOptions = [];
338
339
        return $this;
340
    }
341
342
343
    /**
344
     * Проверяет есть ли драйвер метаданных с заданным именем
345
     *
346
     * @param string $metadataDriverName
347
     *
348
     * @return boolean
349
     */
350
    public function hasMetadataDriver($metadataDriverName)
351
    {
352
        return array_key_exists($metadataDriverName, $this->metadataDrivers);
353
    }
354
355
    /**
356
     * Возвращает конфиг драйвера метаданных по заданному имени
357
     *
358
     * @param $metadataDriverName
359
     *
360
     * @return PluginOptions
361
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
362
     */
363 View Code Duplication
    public function getMetadataDriver($metadataDriverName)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
364
    {
365
        if (array_key_exists($metadataDriverName, $this->metadataDriversOptions)) {
366
            return $this->metadataDriversOptions[$metadataDriverName];
367
        }
368
369
        if (!$this->hasMetadataDriver($metadataDriverName)) {
370
            $errMsg = sprintf('Metadata driver %s not found', $metadataDriverName);
371
            throw new Exception\InvalidArgumentException($errMsg);
372
        }
373
374
        $this->metadataDriversOptions[$metadataDriverName] = new PluginOptions($this->metadataDrivers[$metadataDriverName]);
375
376
        return $this->metadataDriversOptions[$metadataDriverName];
377
    }
378
379
    /**
380
     * Устанавливает данные описывающие конструкторы объектов
381
     *
382
     * @param array $objectConstructors
383
     *
384
     * @return $this
385
     */
386
    public function setObjectConstructors(array $objectConstructors)
387
    {
388
        $this->objectConstructors = $objectConstructors;
389
        $this->objectConstructorsOptions = [];
390
391
        return $this;
392
    }
393
394
395
    /**
396
     * Проверяет есть конструктор объектов с заданным именем
397
     *
398
     * @param string $objectConstructorName
399
     *
400
     * @return boolean
401
     */
402
    public function hasObjectConstructor($objectConstructorName)
403
    {
404
        return array_key_exists($objectConstructorName, $this->objectConstructors);
405
    }
406
407
    /**
408
     * Возвращает конструктор объектов по заданному имени
409
     *
410
     * @param $objectConstructorName
411
     *
412
     * @return PluginOptions
413
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
414
     */
415 View Code Duplication
    public function getObjectConstructor($objectConstructorName)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
416
    {
417
        if (array_key_exists($objectConstructorName, $this->objectConstructorsOptions)) {
418
            return $this->objectConstructorsOptions[$objectConstructorName];
419
        }
420
421
        if (!$this->hasObjectConstructor($objectConstructorName)) {
422
            $errMsg = sprintf('Object constructor %s not found', $objectConstructorName);
423
            throw new Exception\InvalidArgumentException($errMsg);
424
        }
425
426
        $this->objectConstructorsOptions[$objectConstructorName] = new PluginOptions($this->objectConstructors[$objectConstructorName]);
427
428
        return $this->objectConstructorsOptions[$objectConstructorName];
429
    }
430
431
    /**
432
     * Устанавливает набор плагинов используемх для сериализации
433
     *
434
     * @param array $serializationVisitors
435
     *
436
     * @return $this
437
     */
438
    public function setSerializationVisitors(array $serializationVisitors)
439
    {
440
        $this->serializationVisitors = $serializationVisitors;
441
442
        return $this;
443
    }
444
445
446
    /**
447
     * Проверяет по указанному имени, наличие набора плагинов используемых для сериализации данных
448
     *
449
     * @param string $serializationVisitorName
450
     *
451
     * @return boolean
452
     */
453
    public function hasSerializationVisitor($serializationVisitorName)
454
    {
455
        return array_key_exists($serializationVisitorName, $this->serializationVisitors);
456
    }
457
458
459
    /**
460
     * Возвращает по указанному имени, набор плагинов используемых для сериализации данных
461
     *
462
     * @param $serializationVisitorName
463
     *
464
     * @return PluginOptions
465
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
466
     */
467
    public function getSerializationVisitor($serializationVisitorName)
468
    {
469
        if (!$this->hasSerializationVisitor($serializationVisitorName)) {
470
            $errMsg = sprintf('Invalid serialization visitor name %s not found', $serializationVisitorName);
471
            throw new Exception\InvalidArgumentException($errMsg);
472
        }
473
        return $this->serializationVisitors[$serializationVisitorName];
474
    }
475
476
    /**
477
     * Возвращает набор плагинов используемых для десериализации
478
     *
479
     * @param array $deserializationVisitors
480
     *
481
     * @return $this
482
     */
483
    public function setDeserializationVisitors(array $deserializationVisitors)
484
    {
485
        $this->deserializationVisitors = $deserializationVisitors;
486
487
        return $this;
488
    }
489
490
491
    /**
492
     * Проверяет по указанному имени, наличие набора плагинов используемых для десериализации данных
493
     *
494
     * @param string $deserializationVisitorName
495
     *
496
     * @return boolean
497
     */
498
    public function hasDeserializationVisitor($deserializationVisitorName)
499
    {
500
        return array_key_exists($deserializationVisitorName, $this->deserializationVisitors);
501
    }
502
503
504
    /**
505
     * Возвращает по указанному имени, набор плагинов используемых для десериализации данных
506
     *
507
     * @param $deserializationVisitorName
508
     *
509
     * @return PluginOptions
510
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
511
     */
512
    public function getDeserializationVisitor($deserializationVisitorName)
513
    {
514
        if (!$this->hasDeserializationVisitor($deserializationVisitorName)) {
515
            $errMsg = sprintf('Invalid deserialization visitor name %s not found', $deserializationVisitorName);
516
            throw new Exception\InvalidArgumentException($errMsg);
517
        }
518
        return $this->deserializationVisitors[$deserializationVisitorName];
519
    }
520
521
    /**
522
     * Устанавливает набор данных описывающих диспетчеры событий
523
     *
524
     * @param array $eventDispatchers
525
     *
526
     * @return $this
527
     */
528
    public function setEventDispatchers(array $eventDispatchers)
529
    {
530
        $this->eventDispatchers = $eventDispatchers;
531
        $this->eventDispatchersOptions = [];
532
533
        return $this;
534
    }
535
536
    /**
537
     * Проверяет есть ли диспетчер событий с заданным именем
538
     *
539
     * @param string $eventDispatcherName
540
     *
541
     * @return boolean
542
     */
543
    public function hasEventDispatcher($eventDispatcherName)
544
    {
545
        return array_key_exists($eventDispatcherName, $this->eventDispatchers);
546
    }
547
548
    /**
549
     * Возвращает диспетчер событий по заданному имени
550
     *
551
     * @param $eventDispatcherName
552
     *
553
     * @return PluginOptions
554
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
555
     */
556 View Code Duplication
    public function getEventDispatcher($eventDispatcherName)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
557
    {
558
        if (array_key_exists($eventDispatcherName, $this->eventDispatchersOptions)) {
559
            return $this->eventDispatchersOptions[$eventDispatcherName];
560
        }
561
562
        if (!$this->hasEventDispatcher($eventDispatcherName)) {
563
            $errMsg = sprintf('Event dispatcher %s not found', $eventDispatcherName);
564
            throw new Exception\InvalidArgumentException($errMsg);
565
        }
566
567
        $this->eventDispatchersOptions[$eventDispatcherName] = new PluginOptions($this->eventDispatchers[$eventDispatcherName]);
568
569
        return $this->eventDispatchersOptions[$eventDispatcherName];
570
    }
571
572
    /**
573
     * Возвращает сервиса для получения кеша доктрины
574
     *
575
     * @return string
576
     */
577
    public function getAnnotationCache()
578
    {
579
        return $this->annotationCache;
580
    }
581
582
    /**
583
     * Устанавливает имя сервиса для получения кеша доктрины
584
     *
585
     * @param string $annotationCache
586
     *
587
     * @return $this
588
     */
589
    public function setAnnotationCache($annotationCache)
590
    {
591
        $this->annotationCache = $annotationCache;
592
593
        return $this;
594
    }
595
596
    /**
597
     * Устанавливает данные описывающие FileLocator используемые в драйверах метаданных
598
     *
599
     * @param array $fileLocators
600
     *
601
     * @return $this
602
     */
603
    public function setFileLocators(array $fileLocators)
604
    {
605
        $this->fileLocators = $fileLocators;
606
        $this->fileLocatorsOptions = [];
607
608
        return $this;
609
    }
610
611
    /**
612
     * Проверяет есть ли FileLocator  с заданным именем
613
     *
614
     * @param string $fileLocatorName
615
     *
616
     * @return boolean
617
     */
618
    public function hasFileLocator($fileLocatorName)
619
    {
620
        return array_key_exists($fileLocatorName, $this->fileLocators);
621
    }
622
623
    /**
624
     * Возвращает FileLocator с заданным именем
625
     *
626
     * @param $fileLocatorName
627
     *
628
     * @return PluginOptions
629
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
630
     */
631 View Code Duplication
    public function getFileLocator($fileLocatorName)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
632
    {
633
        if (array_key_exists($fileLocatorName, $this->fileLocatorsOptions)) {
634
            return $this->fileLocatorsOptions[$fileLocatorName];
635
        }
636
637
        if (!$this->hasFileLocator($fileLocatorName)) {
638
            $errMsg = sprintf('File locator %s not found', $fileLocatorName);
639
            throw new Exception\InvalidArgumentException($errMsg);
640
        }
641
642
        $this->fileLocatorsOptions[$fileLocatorName] = new PluginOptions($this->fileLocators[$fileLocatorName]);
643
644
        return $this->fileLocatorsOptions[$fileLocatorName];
645
    }
646
647
    /**
648
     * Устанавливает данные описывающие Visitor'ы
649
     *
650
     * @param array $visitors
651
     *
652
     * @return $this
653
     */
654
    public function setVisitors(array $visitors)
655
    {
656
        $this->visitors = $visitors;
657
        $this->visitorsOptions = [];
658
659
        return $this;
660
    }
661
662
    /**
663
     * Проверяет есть ли Visitor  с заданным именем
664
     *
665
     * @param string $visitorName
666
     *
667
     * @return boolean
668
     */
669
    public function hasVisitor($visitorName)
670
    {
671
        return array_key_exists($visitorName, $this->visitors);
672
    }
673
674
    /**
675
     * Возвращает Visistor с заданным именем
676
     *
677
     * @param $visitorName
678
     *
679
     * @return PluginOptions
680
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
681
     */
682 View Code Duplication
    public function getVisitor($visitorName)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
683
    {
684
        if (array_key_exists($visitorName, $this->visitorsOptions)) {
685
            return $this->visitorsOptions[$visitorName];
686
        }
687
688
        if (!$this->hasVisitor($visitorName)) {
689
            $errMsg = sprintf('Visitor %s not found', $visitorName);
690
            throw new Exception\InvalidArgumentException($errMsg);
691
        }
692
693
        $this->visitorsOptions[$visitorName] = new PluginOptions($this->visitors[$visitorName]);
694
695
        return $this->visitorsOptions[$visitorName];
696
    }
697
698
    /**
699
     * Устанавливает настройки стратегий для работы с именами свойств объектов
700
     *
701
     * @param array $namingStrategies
702
     *
703
     * @return $this
704
     */
705
    public function setNamingStrategies(array $namingStrategies)
706
    {
707
        $this->namingStrategies = $namingStrategies;
708
        $this->namingStrategiesOptions = [];
709
710
        return $this;
711
    }
712
713
714
    /**
715
     * Проверяет есть ли стратегия  с заданным именем
716
     *
717
     * @param string $strategyName
718
     *
719
     * @return boolean
720
     */
721
    public function hasNamingStrategy($strategyName)
722
    {
723
        return array_key_exists($strategyName, $this->namingStrategies);
724
    }
725
726
727
    /**
728
     * Возвращает стратегию с заданным именем
729
     *
730
     * @param $strategyName
731
     *
732
     * @return PluginOptions
733
     * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException
734
     */
735 View Code Duplication
    public function getNamingStrategy($strategyName)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
736
    {
737
        if (array_key_exists($strategyName, $this->namingStrategiesOptions)) {
738
            return $this->namingStrategiesOptions[$strategyName];
739
        }
740
741
        if (!$this->hasNamingStrategy($strategyName)) {
742
            $errMsg = sprintf('Naming strategy %s not found', $strategyName);
743
            throw new Exception\InvalidArgumentException($errMsg);
744
        }
745
746
        $this->namingStrategiesOptions[$strategyName] = new PluginOptions($this->namingStrategies[$strategyName]);
747
748
        return $this->namingStrategiesOptions[$strategyName];
749
    }
750
751
    /**
752
     * Возвращает контейнер для получения сущностей
753
     *
754
     * @return string
755
     */
756
    public function getEntityLocator()
757
    {
758
        return $this->entityLocator;
759
    }
760
761
    /**
762
     * Устанавливает контейнер для получения сущностей
763
     *
764
     * @param string $entityLocator
765
     *
766
     * @return $this
767
     */
768
    public function setEntityLocator($entityLocator)
769
    {
770
        $this->entityLocator = $entityLocator;
771
772
        return $this;
773
    }
774
}
775