Ejemplo n.º 1
0
 /**
  * $pluginManager should be an instance of
  * Zend\Stdlib\Hydrator\HydratorPluginManager.
  *
  * @param ServiceManager $pluginManager
  */
 public function __construct(ServiceManager $pluginManager)
 {
     if (!$pluginManager instanceof HydratorPluginManager) {
         throw new Exception\InvalidArgumentException(sprintf('%s expects an instance of Zend\\Stdlib\\Hydrator\\HydratorPluginManager; received "%s"', __CLASS__, get_class($pluginManager)));
     }
     parent::__construct($pluginManager);
 }
 /**
  * Retrieve all plugins
  *
  * Merges the list of plugins with the plugin metadata
  *
  * @return array
  */
 protected function getPlugins()
 {
     if (is_array($this->plugins)) {
         return $this->plugins;
     }
     $plugins = parent::getPlugins();
     $plugins = array_flip($plugins);
     $plugins = array_merge($plugins, $this->metadata->fetchAll());
     array_walk($plugins, function (&$value) {
         if (is_array($value)) {
             return;
         }
         $value = ['breakchainonfailure' => 'bool'];
     });
     $this->plugins = $plugins;
     return $this->plugins;
 }
Ejemplo n.º 3
0
 /**
  * Retrieve all plugins
  *
  * Merges the list of plugins with the plugin metadata
  *
  * @return array
  */
 protected function getPlugins()
 {
     if (is_array($this->plugins)) {
         return $this->plugins;
     }
     $plugins = parent::getPlugins();
     $plugins = array_flip($plugins);
     $metadata = $this->metadata;
     array_walk($plugins, function (&$value, $key) use($metadata) {
         if (!array_key_exists($key, $metadata)) {
             $value = [];
             return;
         }
         $value = $metadata[$key];
     });
     $this->plugins = $plugins;
     return $this->plugins;
 }