You are here

class HydratorPluginManager in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-hydrator/src/HydratorPluginManager.php \Zend\Hydrator\HydratorPluginManager
  2. 8 vendor/zendframework/zend-stdlib/src/Hydrator/HydratorPluginManager.php \Zend\Stdlib\Hydrator\HydratorPluginManager
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-hydrator/src/HydratorPluginManager.php \Zend\Hydrator\HydratorPluginManager

Plugin manager implementation for hydrators.

Enforces that adapters retrieved are instances of HydratorInterface

Hierarchy

Expanded class hierarchy of HydratorPluginManager

1 file declares its use of HydratorPluginManager
HydratorPluginManager.php in vendor/zendframework/zend-stdlib/src/Hydrator/HydratorPluginManager.php

File

vendor/zendframework/zend-hydrator/src/HydratorPluginManager.php, line 19

Namespace

Zend\Hydrator
View source
class HydratorPluginManager extends AbstractPluginManager {

  /**
   * Whether or not to share by default
   *
   * @var bool
   */
  protected $shareByDefault = false;

  /**
   * Default aliases
   *
   * @var array
   */
  protected $aliases = [
    'delegatinghydrator' => 'Zend\\Hydrator\\DelegatingHydrator',
  ];

  /**
   * Default set of adapters
   *
   * @var array
   */
  protected $invokableClasses = [
    'arrayserializable' => 'Zend\\Hydrator\\ArraySerializable',
    'classmethods' => 'Zend\\Hydrator\\ClassMethods',
    'objectproperty' => 'Zend\\Hydrator\\ObjectProperty',
    'reflection' => 'Zend\\Hydrator\\Reflection',
  ];

  /**
   * Default factory-based adapters
   *
   * @var array
   */
  protected $factories = [
    'Zend\\Hydrator\\DelegatingHydrator' => 'Zend\\Hydrator\\DelegatingHydratorFactory',
  ];

  /**
   * {@inheritDoc}
   */
  public function validatePlugin($plugin) {
    if ($plugin instanceof HydratorInterface) {

      // we're okay
      return;
    }
    throw new Exception\RuntimeException(sprintf('Plugin of type %s is invalid; must implement Zend\\Hydrator\\HydratorInterface', is_object($plugin) ? get_class($plugin) : gettype($plugin)));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HydratorPluginManager::$aliases protected property Default aliases
HydratorPluginManager::$factories protected property Default factory-based adapters
HydratorPluginManager::$invokableClasses protected property Default set of adapters
HydratorPluginManager::$shareByDefault protected property Whether or not to share by default
HydratorPluginManager::validatePlugin public function