@@ 311-325 (lines=15) @@ | ||
308 | * @return PluginOptions |
|
309 | * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException |
|
310 | */ |
|
311 | public function getHandlerRegistry($handlerRegistryName) |
|
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 | * Устанавливает данные описывающие драйверы метаданных |
|
@@ 363-377 (lines=15) @@ | ||
360 | * @return PluginOptions |
|
361 | * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException |
|
362 | */ |
|
363 | public function getMetadataDriver($metadataDriverName) |
|
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 | * Устанавливает данные описывающие конструкторы объектов |
|
@@ 415-429 (lines=15) @@ | ||
412 | * @return PluginOptions |
|
413 | * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException |
|
414 | */ |
|
415 | public function getObjectConstructor($objectConstructorName) |
|
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 | * Устанавливает набор плагинов используемх для сериализации |
|
@@ 556-570 (lines=15) @@ | ||
553 | * @return PluginOptions |
|
554 | * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException |
|
555 | */ |
|
556 | public function getEventDispatcher($eventDispatcherName) |
|
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 | * Возвращает сервиса для получения кеша доктрины |
|
@@ 631-645 (lines=15) @@ | ||
628 | * @return PluginOptions |
|
629 | * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException |
|
630 | */ |
|
631 | public function getFileLocator($fileLocatorName) |
|
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'ы |
|
@@ 682-696 (lines=15) @@ | ||
679 | * @return PluginOptions |
|
680 | * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException |
|
681 | */ |
|
682 | public function getVisitor($visitorName) |
|
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 | * Устанавливает настройки стратегий для работы с именами свойств объектов |
|
@@ 735-749 (lines=15) @@ | ||
732 | * @return PluginOptions |
|
733 | * @throws \Nnx\JmsSerializerModule\Options\Exception\InvalidArgumentException |
|
734 | */ |
|
735 | public function getNamingStrategy($strategyName) |
|
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 | * Возвращает контейнер для получения сущностей |