/** * Get the helper broker or a helper instance * * @return Broker|Action\Helper\AbstractHelper */ public function broker($name = null) { if (null === $name) { return $this->broker; } return $this->broker->load($name); }
/** * Plugin Broker * * Set or retrieve the plugin broker, or retrieve a specific plugin from it. * * If $name is null, the broker instance is returned; it will be lazy-loaded * if not already present. * * If $name is a Broker instance, this broker instance will replace or set * the internal broker, and the instance will be returned. * * If $name is a string, $name and $options will be passed to the broker's * load() method. * * @param null|Broker|string $name * @param array $options * @return Broker|Filter */ public function broker($name = null, $options = array()) { if ($name instanceof Broker) { $this->broker = $broker; return $this->broker; } if (null === $this->broker) { $this->broker = new FilterBroker(); } if (null === $name) { return $this->broker; } return $this->broker->load($name, $options); }