Skip to content

Commit 25931da

Browse files
authored
Merge pull request #458 from joomla/remove/dispatcher
Remove the dispatch event functions in model and view
2 parents 0b0f536 + 45beea4 commit 25931da

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

migrations/54-60/removed-backward-incompatibility.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,22 @@ $table = new \Joomla\CMS\Table\Content($db);
244244
- File: libraries/src/Application/WebApplication.php
245245
- Description: The `$item_associations` was added to the `WebApplication` class for improved PHP 8.2 compatibility and is not used at all.
246246

247+
## `dispatchEvent` Proxy Functions Removed in View and Model
248+
249+
- PR: https://github.com/joomla/joomla-cms/pull/45431
250+
- Files:
251+
- libraries/src/MVC/Model/BaseDatabaseModel.php
252+
- libraries/src/MVC/View/AbstractView.php
253+
- Description: The `dispatchEvent` proxy functions are removed in the `BaseDatabaseModel` and `AbstractView` classes. The `getDispatcher` function therefore requires now a dispatcher injected, which is the default when the component is booted through the application.
254+
255+
```php
256+
// Old in extending class from the BaseDatabaseModel or AbstractView classes:
257+
$this->dispatchEvent($event);
258+
259+
// New:
260+
$this->getDispatcher()->dispatch($event->getName(), $event);
261+
```
262+
247263
## `getLogContentTypeParams` Method Removed from of `ActionlogsHelper`
248264

249265
- PR: https://github.com/joomla/joomla-cms/pull/45434

0 commit comments

Comments
 (0)