3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Stdlib\Hydrator
;
12 use Zend\ServiceManager\AbstractPluginManager
;
13 use Zend\Stdlib\Exception
;
16 * Plugin manager implementation for hydrators.
18 * Enforces that adapters retrieved are instances of HydratorInterface
20 class HydratorPluginManager
extends AbstractPluginManager
23 * Whether or not to share by default
27 protected $shareByDefault = false;
30 * Default set of adapters
34 protected $invokableClasses = array(
35 'arrayserializable' => 'Zend\Stdlib\Hydrator\ArraySerializable',
36 'classmethods' => 'Zend\Stdlib\Hydrator\ClassMethods',
37 'objectproperty' => 'Zend\Stdlib\Hydrator\ObjectProperty',
38 'reflection' => 'Zend\Stdlib\Hydrator\Reflection'
44 public function validatePlugin($plugin)
46 if ($plugin instanceof HydratorInterface
) {
51 throw new Exception\
RuntimeException(sprintf(
52 'Plugin of type %s is invalid; must implement Zend\Stdlib\Hydrator\HydratorInterface',
53 (is_object($plugin) ?
get_class($plugin) : gettype($plugin))