Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Stdlib / Hydrator / HydratorPluginManager.php
blob0e9892a25299f317212b2cde3ccdc7bd4c45b41b
1 <?php
2 /**
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
8 */
10 namespace Zend\Stdlib\Hydrator;
12 use Zend\ServiceManager\AbstractPluginManager;
13 use Zend\Stdlib\Exception;
15 /**
16 * Plugin manager implementation for hydrators.
18 * Enforces that adapters retrieved are instances of HydratorInterface
20 class HydratorPluginManager extends AbstractPluginManager
22 /**
23 * Whether or not to share by default
25 * @var bool
27 protected $shareByDefault = false;
29 /**
30 * Default set of adapters
32 * @var array
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'
41 /**
42 * {@inheritDoc}
44 public function validatePlugin($plugin)
46 if ($plugin instanceof HydratorInterface) {
47 // we're okay
48 return;
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))
54 ));