zikula/core — Issue #236: Only one handler per hook type allowed
Author: landseer
Created: 2012-01-11 20:21:55+00:00
State: open

I want to define a hook bundle with several filter hooks, but there is only one handler per hook type allowed.

```php
$bundle->addStaticHandler('filter', 'HookProvider_HookHandler_filterone', 'ui_filter', true);
$bundle->addStaticHandler('filter', 'HookProvider_HookHandler_filtertwo', 'ui_filter', true);
$bundle->addStaticHandler('filter', 'HookProvider_HookHandler_filterthree', 'ui_filter', true);
```
(also valid for service handlers)

Only HookProvider_HookHandler_filterthree is stored in the hook_provider table. May make sense for ui hooks, but not for filter hooks imho.

See lib/Zikula/HookManager/ProviderBundle.php:

```php
public function addStaticHandler($hookType, $className, $method)
{
return $this->addHandler($hookType, $className, $method);
}
```

and

```php
private function addHandler($hookType, $className, $method, $serviceId=null)
{
$this->hooks[$hookType] = array(
'hooktype' => $hookType,
'classname' => $className,
'method' => $method,
'serviceid' => $serviceId,
);
return $this;
}
```

Perhaps addhandler() should fill an arrays of arrays.