The event emitter should not be a dependency

Fixes #2938
This commit is contained in:
Samuel Georges 2017-06-23 08:11:41 +10:00
parent b572382de7
commit c3570ffd7e
1 changed files with 9 additions and 1 deletions

View File

@ -1018,11 +1018,19 @@ class Form extends WidgetBase
*/
protected function applyFiltersFromModel()
{
/*
* Standard usage
*/
if (method_exists($this->model, 'filterFields')) {
$this->model->filterFields((object) $this->allFields, $this->getContext());
}
$this->model->fireEvent('model.form.filterFields', [$this]);
/*
* Advanced usage
*/
if (method_exists($this->model, 'fireEvent')) {
$this->model->fireEvent('model.form.filterFields', [$this]);
}
}
/**