Removed and Backward Incompatibility
All the deprecated features that have now been removed and any backward incompatibilities. There should be an explanation of how to mitigate the removals / changes.
Compat plugin
The following list of changes belong to the compatibility plugin and work when enabled, but are mentioned here, so developers can prepare for upcoming changes in the next major release:
Functions that throw an error
- PR: https://github.com/joomla/joomla-cms/pull/47911
- Files:
- /libraries/src/Factory.php
- /libraries/src/User/User.php
- Description: The compatibility plugin defines the constant
COMPAT_JOOMLA_7when loaded. The constant is used in functions to check if compatibility mode is enabled. If the constant doesn't exist, an exception is thrown in the respective function. Like that get extension developers and site admins, with old overrides, an idea what might not work anymore in the next major version. In the deprecation message and The following list of functions will throw an error when the compatibility plugin is not enabled:\Joomla\CMS\Factory::getConfig()
Get the config from the application.\Joomla\CMS\Factory::getSession()
Get the session from the application.\Joomla\CMS\Factory::getMailer()
Create a mailer from the injected factory or global container.\Joomla\CMS\User\User::get()
Access directly the property from the user object.
CMS Crypt package
- PR: https://github.com/joomla/joomla-cms/pull/47899
- Folder: /libraries/src/Crypt
- Description: The Crypt package of the CMS (
\Joomla\CMS\Crypt) has been deprecated for a long time. Please use the frameworkCryptpackage (\Joomla\Crypt). The packages can be used nearly interchangeably, expect forCrypt::timingSafeCompare()usehash_equals()insteadCrypt::safeStrlen()usemb_strlen()insteadCrypt::safeSubstr()usemb_substr()insteadCipher\SodiumCipher::classuse\Joomla\Crypt\Cipher\Sodium::classinsteadCipher\CryptoCipher::classuse\Joomla\Crypt\Cipher\Crypto::classinstead
Radiobasic form field
- PR: https://github.com/joomla/joomla-cms/pull/47930
- Files:
- /libraries/src/Form/Field/RadiobasicField.php
- /layouts/joomla/form/field/radiobasic.php
- Description: The form field
radiobasicis obsolete and the normal radio form field should be used with the layoutjoomla.form.field.radio.switcher.
// Old:
<field type="radiobasic" />
// New:
<field type="radio" layout="joomla.form.field.radio.switcher"/>
Removed legacy OTP code from UserModel and ProfileModel
- PR: https://github.com/joomla/joomla-cms/pull/47457
- Files:
- /administrator/components/com_users/src/Model/UserModel.php
- /components/com_users/src/Model/ProfileModel.php
- Description: With the introduction of multi-factor authentication in Joomla 4.2, several methods for the one-time-password feature were made obsolete and deprecated. They were not working since 4.2 anyway, but with 7.0 they have been removed entirely. The following methods in the administrator part of
com_userswere removed:UserModel::getOtpConfig()UserModel::setOtpConfig()UserModel::getOtpConfigEncryptionKey()UserModel::getTwofactorform()UserModel::generateOteps()UserModel::isValidSecretKey()UserModel::isValidOtep()ProfileModel::getTwofactorform()ProfileModel::getOtpConfig()
Removed deprecated static functions from module helpers
- PR: https://github.com/joomla/joomla-cms/pull/47891
- Files:
- /administrator/modules/mod_feed/src/Helper/FeedHelper.php
- /administrator/modules/mod_latest/src/Helper/LatestHelper.php
- /administrator/modules/mod_latestactions/src/Helper/LatestActionsHelper.php
- /administrator/modules/mod_logged/src/Helper/LoggedHelper.php
- /administrator/modules/mod_login/src/Helper/LoginHelper.php
- /administrator/modules/mod_privacy_dashboard/src/Helper/PrivacyDashboardHelper.php
- /administrator/modules/mod_privacy_status/src/Helper/PrivacyStatusHelper.php
- /administrator/modules/mod_sampledata/src/Helper/SampledataHelper.php
- /administrator/modules/mod_stats_admin/src/Helper/StatsAdminHelper.php
- /administrator/modules/mod_version/src/Helper/VersionHelper.php
- /modules/mod_articles_archive/src/Helper/ArticlesArchiveHelper.php
- /modules/mod_articles_categories/src/Helper/ArticlesCategoriesHelper.php
- /modules/mod_articles_category/src/Helper/ArticlesCategoryHelper.php
- /modules/mod_articles_latest/src/Helper/ArticlesLatestHelper.php
- /modules/mod_articles_news/src/Helper/ArticlesNewsHelper.php
- /modules/mod_articles_popular/src/Helper/ArticlesPopularHelper.php
- /modules/mod_banners/src/Helper/BannersHelper.php
- /modules/mod_breadcrumbs/src/Helper/BreadcrumbsHelper.php
- /modules/mod_feed/src/Helper/FeedHelper.php
- /modules/mod_finder/src/Helper/FinderHelper.php
- /modules/mod_languages/src/Helper/LanguagesHelper.php
- /modules/mod_login/src/Helper/LoginHelper.php
- /modules/mod_menu/src/Helper/MenuHelper.php
- /modules/mod_random_image/src/Helper/RandomImageHelper.php
- /modules/mod_related_items/src/Helper/RelatedItemsHelper.php
- /modules/mod_stats/src/Helper/StatsHelper.php
- /modules/mod_syndicate/src/Helper/SyndicateHelper.php
- /modules/mod_tags_popular/src/Helper/TagsPopularHelper.php
- /modules/mod_tags_similar/src/Helper/TagsSimilarHelper.php
- /modules/mod_users_latest/src/Helper/UsersLatestHelper.php
- /modules/mod_whosonline/src/Helper/WhosonlineHelper.php
- /modules/mod_wrapper/src/Helper/WrapperHelper.php
- Description: Modules traditionally were written with a static helper class to retrieve data from the system. This isn't desirable from a dependency injection perspective and thus the modules were rewritten to use instantiated helper objects instead with dependency injection. Instantiate the helper object and call the non-static version of the respective method instead. For example you can use:
// Old:
ArticlesNewsHelper::getArticles($params);
// New:
Factory::getApplication()->bootModule('mod_articles_news', 'site')
->getHelper('ArticlesNewsHelper')
->getArticles($params, Factory::getApplication());
CMSPlugin db and app properties detection removed
- PR: https://github.com/joomla/joomla-cms/pull/47881
- File: libraries/src/Plugin/CMSPlugin.php
- Description: The autodetection and fill of the
$appand$dbproperties in theCMSPlugingot removed. Inject the database and application in the provider.php. If it is not possible to use the aware trait or inject the application, then use$this->app = Factory::getApplication();and$this->db = Factory::getContainer()->get(DatabaseInterface::class);in the constructor of your plugin. For example you can use:
// Old:
$this->app;
$this->db;
// New:
$this->getApplication();
$this->getDatabase();
ActionLogPlugin db and app properties removed
- PR: https://github.com/joomla/joomla-cms/pull/47880
- File: /administrator/components/com_actionlogs/src/Plugin/ActionLogPlugin.php
- Description: The
$appand$dbproperties in theActionLogPlugingot removed. Inject the database and application in the provider.php. For example you can use:
// Old:
$this->app;
$this->db;
// New:
$this->getApplication();
$this->getDatabase();
FieldsPlugin app property removed
- PR: https://github.com/joomla/joomla-cms/pull/47904
- File: /administrator/components/com_fields/src/Plugin/FieldsPlugin.php
- Description: The
$appproperty in theFieldsPlugingot removed. Inject the application in the provider.php. For example you can use:
// Old:
$this->app;
// New:
$this->getApplication();
PrivacyPlugin db property removed
- PR: https://github.com/joomla/joomla-cms/pull/47880
- File: /administrator/components/com_privacy/src/Plugin/PrivacyPlugin.php
- Description: The
$dbproperty in theabstract class PrivacyPlugin extends CMSPlugingot removed. Inject the database in the provider.php. For example you can use:
// Old:
$this->db;
// New:
$this->getDatabase();
LogcreatorField class removed
- PR: https://github.com/joomla/joomla-cms/pull/47874
- File: /administrator/components/com_actionlogs/src/Field/LogcreatorField.php
- Description: The
LogcreatorFieldgot removed as it is better to use the user field instead. For example you can use:
// Old in form XML file:
<field name="user" type="logcreator" label="COM_ACTIONLOGS_NAME" class="js-select-submit-on-change">
<option value="">COM_ACTIONLOGS_SELECT_USER</option>
</field>
// New in form XML file:
<field name="user" type="user" label="COM_ACTIONLOGS_NAME" class="js-select-submit-on-change">
<option value="">COM_ACTIONLOGS_SELECT_USER</option>
</field>
The CSS custom property --cassiopeia-link-color removal
- PR: https://github.com/joomla/joomla-cms/pull/47883
- Files:
- /media_source/templates/site/cassiopeia/scss/global/colors_alternative.scss
- /media_source/templates/site/cassiopeia/scss/global/colors_standard.scss
- Description: The CSS custom property
--cassiopeia-link-coloris not used and got removed.
Removed unused methods from localise
- PR: https://github.com/joomla/joomla-cms/pull/47897
- File: /administrator/language/en-GB/localise.php
- Description: Unused filters removed:
--getIgnoredSearchWords--getLowerLimitSearchWord--getUpperLimitSearchWord--getSearchDisplayedCharactersNumber
Removed legacy stubs for component helpers
- PR's:
- Files:
- /components/com_contact/helpers/route.php
- /components/com_content/helpers/icon.php
- /components/com_finder/helpers/route.php
- /components/com_newsfeeds/helpers/route.php
- /components/com_tags/helpers/route.php
- /administrator/components/com_banners/helpers/banners.php
- /administrator/components/com_categories/helpers/categories.php
- /administrator/components/com_contact/helpers/contact.php
- /administrator/components/com_content/helpers/content.php
- /administrator/components/com_content/src/Model/FeaturedModel.php
- /administrator/components/com_content/src/View/Featured/HtmlView.php
- /administrator/components/com_contenthistory/helpers/contenthistory.php
- /administrator/components/com_fields/helpers/fields.php
- /administrator/components/com_fields/src/Plugin/FieldsPlugin.php
- /administrator/components/com_finder/helpers/language.php
- /administrator/components/com_installer/helpers/installer.php
- /administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
- /administrator/components/com_menus/helpers/menus.php
- /administrator/components/com_modules/helpers/modules.php
- /administrator/components/com_modules/src/Service/HTML/Modules.php
- /administrator/components/com_newsfeeds/helpers/newsfeeds.php
- /administrator/components/com_plugins/helpers/plugins.php
- /administrator/components/com_privacy/src/Plugin/PrivacyPlugin.php
- /administrator/components/com_redirect/helpers/redirect.php
- /administrator/components/com_templates/helpers/template.php
- /administrator/components/com_templates/helpers/templates.php
- /administrator/components/com_templates/src/Service/HTML/Templates.php
- /administrator/components/com_users/helpers/debug.php
- /administrator/components/com_users/helpers/users.php
- Description: The non-namespaced helper classes in the
helpers/folder of several components were deprecated in 4.3 and only forwarded to their namespaced replacements. They have now been removed entirely. They are not registered in thebehaviour/compat7plugin classmap, so referencing the old global class name results in a "class not found" fatal error. Replace any use of the old class with the namespaced class below (add the matchingusestatement); all public method signatures are unchanged. To fix any errors, make a search and replace to use the namespaced versions now, e.g. - Class list mapping:
ContactHelperRoute— use\Joomla\Component\Contact\Site\Helper\RouteHelper\ContactHelperRouteinsteadJHtmlIcon— use\Joomla\Component\Content\Administrator\Service\HTML\IconinsteadFinderHelperRoute— use\Joomla\Component\Finder\Site\Helper\RouteHelper\FinderHelperRouteinsteadNewsfeedsHelperRoute— use\Joomla\Component\Newsfeeds\Site\Helper\RouteHelper\NewsfeedsHelperRouteinsteadTagsHelperRoute— use\Joomla\Component\Tags\Site\Helper\RouteHelper\TagsHelperRouteinsteadBannersHelper— use\Joomla\Component\Banners\Administrator\Helper\BannersHelperinsteadCategoriesHelper— use\Joomla\Component\Categories\Administrator\Helper\CategoriesHelperinsteadContactHelper— use\Joomla\Component\Contact\Administrator\Helper\ContactHelperinsteadContentHelper— use\Joomla\Component\Content\Administrator\Helper\ContentHelperinsteadContenthistoryHelper— use\Joomla\Component\Contenthistory\Administrator\Helper\ContenthistoryHelperinsteadFieldsHelper— use\Joomla\Component\Fields\Administrator\Helper\FieldsHelperinsteadFinderHelperLanguage— use\Joomla\Component\Finder\Administrator\Helper\LanguageHelperinsteadInstallerHelper— use\Joomla\Component\Installer\Administrator\Helper\InstallerHelperinsteadMenusHelper— use\Joomla\Component\Menus\Administrator\Helper\MenusHelperinsteadModulesHelper— use\Joomla\Component\Modules\Administrator\Helper\ModulesHelperinsteadNewsfeedsHelper— use\Joomla\Component\Newsfeeds\Administrator\Helper\NewsfeedsHelperinsteadPluginsHelper— use\Joomla\Component\Plugins\Administrator\Helper\PluginsHelperinsteadRedirectHelper— use\Joomla\Component\Redirect\Administrator\Helper\RedirectHelperinsteadTemplateHelper— use\Joomla\Component\Templates\Administrator\Helper\TemplateHelperinsteadTemplatesHelper— use\Joomla\Component\Templates\Administrator\Helper\TemplatesHelperinsteadUsersHelperDebug— use\Joomla\Component\Users\Administrator\Helper\DebugHelperinsteadUsersHelper— use\Joomla\Component\Users\Administrator\Helper\UsersHelperinstead
// Old:
BannersHelper::function();
// New
\Joomla\Component\Banners\Administrator\Helper\BannersHelper::function();
Removed local log entry functionality in debug plugin
- PR: https://github.com/joomla/joomla-cms/pull/47900
- File: /plugins/system/debug/src/Extension/Debug.php
- Description: Removes the
logger()function in the\Joomla\Plugin\System\Debug\Extension\Debug::classin the debug system plugin.
// Old:
$app->bootPlugin('debug', 'system')->logger();
// New:
\Joomla\CMS\Log\Log::add();
Make onDisplay methods private in editor button plugins
- PR: https://github.com/joomla/joomla-cms/pull/47902
- Files:
- /plugins/editors-xtd/article/src/Extension/Article.php
- /plugins/editors-xtd/contact/src/Extension/Contact.php
- /plugins/editors-xtd/fields/src/Extension/Fields.php
- /plugins/editors-xtd/image/src/Extension/Image.php
- /plugins/editors-xtd/menu/src/Extension/Menu.php
- /plugins/editors-xtd/module/src/Extension/Module.php
- /plugins/editors-xtd/pagebreak/src/Extension/PageBreak.php
- /plugins/editors-xtd/readmore/src/Extension/ReadMore.php
- Description: Removes the
onDisplay()method and added a private 'getButton()' method
Removed deprecated layout files
- PR: https://github.com/joomla/joomla-cms/pull/47884
- Files:
- /layouts/joomla/content/icons/create.php
- /layouts/joomla/html/batch/user.php
- Description: Removed unused layout files, there is no replacement for them.
Removed stub generator and PSR12 converter
- PR: https://github.com/joomla/joomla-cms/pull/47897
- File: /build/stubGenerator.php
- Folder: /build/psr12
- Description: The stub generator was only for transition to make it easier to translate from Jx namespace to real php namespaces. The PSR12 converter was a onetime shot to get the Joomla code base to PSR12 / PER Coding Style. If you still need the stub generator or the psr12 converter, use it from an older joomla version.
Removed Joomla.popupWindow function
- PR: https://github.com/joomla/joomla-cms/pull/47908
- File: /media_source/legacy/js/toolbar.es5.js
- Description: The function
Joomla.popupWindowis not used and got removed. To create popup windows use browser native call instead.
Removed the window.Calendar instance in calendar.js
- PR: https://github.com/joomla/joomla-cms/pull/47907
- File: /media_source/system/js/fields/calendar.es5.js
- Description: In Javascript should the
JoomlaCalendarinstance be used and not anymorewindow.calendar.
// Old:
window.Calendar.setup();
// New:
JoomlaCalendar.init();
Removed Methods from models
- PR: https://github.com/joomla/joomla-cms/pull/47501
- Files:
- /administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
- /administrator/components/com_modules/src/Service/HTML/Modules.php
- /components/com_content/src/Model/ArchiveModel.php
- Description: The method to get the archived article list
getData()is removed, usegetItems()instead. The method to get the positions listpositionList()is removed without replacement. The methodcreateRestorationFil()is removed, usecreateUpdateFile()instead.
// Old:
$updateModel->createRestorationFile();
$archiveModel->getData();
// New:
$updateModel->createUpdateFile();
$archiveModel->getItems();
Removed tinymce uploaddirs field
- PR: https://github.com/joomla/joomla-cms/pull/47913
- File: /plugins/editors/tinymce/src/Field/UploaddirsField.php
- Description: The field is not used by core anymore instead
Joomla\CMS\Form\Field\FolderlistFieldis used.
// Old:
<field type="Uploaddirs" />
// New:
<field type="Folderlist" />
Removed Joomla.JText proxy
- PR: https://github.com/joomla/joomla-cms/pull/47928
- File: /media_source/system/js/core.es6.js
- Description: Removes the deprecated global
Joomla.JTextJavascript property. UseJoomla.Textinstead.
// Old:
Joomla.JText._('COM_FOO');
// New:
Joomla.Text._('COM_FOO');
Removed support for string parameters to generate template thumbnails
- PR: https://github.com/joomla/joomla-cms/pull/47924
- File: /administrator/components/com_templates/src/Service/HTML/Templates.php
- Description: The method to get the thumbnails accept only a template object and not anymore a string.
// Old:
HTMLHelper::_('templates.thumb', $item->name);
HTMLHelper::_('templates.thumbModal', $item->name);
// New:
HTMLHelper::_('templates.thumb', $item);
HTMLHelper::_('templates.thumbModal', $item);
Url layout file is not escaping the url
- PR: https://github.com/joomla/joomla-cms/pull/47929
- File: /layouts/joomla/form/field/url.php
- Description: The url layout file is not escaping the url anymore, the logic is moved to the
UrlFieldclass. If the layout file /layouts/joomla/form/field/url.php is used in an extension, then the encoding must be done by again.
// Old:
LayoutHelper::render('joomla.form.field.url', ['value' => 'https://www.joomla.org']);
// New:
LayoutHelper::render('joomla.form.field.url', ['value' => htmlspecialchars(PunycodeHelper::urlToUTF8('https://www.joomla.org'), ENT_QUOTES, 'UTF-8')]);
BannerHelper class got removed
- PR: https://github.com/joomla/joomla-cms/pull/47937
- File: /components/com_banners/src/Helper/BannerHelper.php
- Description: The
BannerHelpergot removed as it contains only an image test function. When testing the image file, use\Joomla\CMS\Helper\MediaHelper::isImage($url)for pixel-based image files in combination with\Joomla\CMS\Helper\MediaHelper::getMimeType($url) === 'image/svg+xml'for vector based image files. Be aware that the image url should first be sanitized with the helper function.
// Old:
BannerHelper::isImage($url);
// New:
MediaHelper::isImage(HTMLHelper::cleanImageURL($url));
Removed deprecated code in the application classes
- PR: https://github.com/joomla/joomla-cms/pull/45866
- Files:
- libraries/src/Application/CMSApplication.php
- libraries/src/Application/CMSApplicationInterface.php
- libraries/src/Application/AdministratorApplication.php
- libraries/src/Application/ApiApplication.php
- libraries/src/Application/ConsoleApplication.php
- libraries/src/Application/WebApplication.php
- Description: Several pieces of deprecated code have been removed from the core application classes.
- The obsolete
loadSession()method and staticpurgeMessages()method have been removed. For example you can use: - The magic
__get()accessor on the console application has been removed, so protected/dynamic properties can no longer be read directly as$app->somPropertyuse the dedicated getter methods instead. - The deprecated
getCfg()method has been removed (read configuration withget()). - The API application doesn't have anymore the
getApiRouterfunction.
- The obsolete
// Old:
$value = $app->getCfg('sitename');
AdministratorApplication:purgeMessages();
ApiApplication::getApiRouter();
$value = $app->input;
// New:
$value = $app->get('sitename');
Factory::getApplication()->bootComponent('messages')->getMVCFactory()
->createModel('Messages', 'Administrator')->purge(Factory::getApplication()->getIdentity()->id);
Factory::getContainer()->get(ApiRouter::class);
$value = $app->getInput();
Removed User Authentication hashes
- PR: https://github.com/joomla/joomla-cms/pull/44237
- Files:
- libraries/phpass/PasswordHash.php
- libraries/src/Authentication/Password/PHPassHandler.php
- Description: The
PHPassHandlergot removed as it doesn't work anymore in Joomla. The resource'password.handler.phpass'is not available anymore in the DI container, therefor thePasswordHashclass alias doesn't exist as well.
Users which hasn't logged in since Joomla! 3.2.1 will need to use the password reset method since the password can not longer be validated.
Removed LegacyPropertyManagementTrait from several classes
-
PR's:
-
Files:
- /libraries/src/Categories/CategoryNode.php
- /libraries/src/Changelog/Changelog.php
- /libraries/src/MVC/Model/BaseModel.php
- /libraries/src/MVC/View/AbstractView.php
- /libraries/src/Table/Table.php
- /libraries/src/User/User.php
-
Description: The
\Joomla\CMS\Object\LegacyPropertyManagementTraithas been deprecated since Joomla 4.3 (the code itself goes back to the oldJObjectclass, which has been deprecated since Joomla 3.4). The trait circumvents the visibility of class properties and allows reading and writing any property, even protected ones, through generic methods. It has been removed from the classes below (forTableonly the usage in core has been removed so far), which means the following methods are not available anymore on these classes:def()get()getProperties()set()setProperties()
Access public properties directly, use the dedicated getter and setter methods of the class or use
\Joomla\Utilities\ArrayHelper::fromObject($object, false)to get all public properties as an array.
CategoryNode
The \Joomla\CMS\Categories\CategoryNode class doesn't use the trait anymore. Access the public properties directly or use the existing getter methods like getParent(), getChildren(), getParams(), getMetadata(), getPath() and getAuthor().
// Old:
$title = $category->get('title');
$category->set('title', 'New title');
// New:
$title = $category->title;
$category->title = 'New title';
Changelog
The \Joomla\CMS\Changelog\Changelog class doesn't use the trait anymore. To keep the data accessible, the properties $element, $type, $version, $security, $fix, $language, $addition, $change, $remove, $note, $currentChangelog, $latest and $folder have been changed from protected to public.
// Old:
$field = $changelog->get('security');
// New:
$field = $changelog->security ?? null;
BaseModel and AbstractView
The \Joomla\CMS\MVC\Model\BaseModel and \Joomla\CMS\MVC\View\AbstractView classes, and with that all models and views extending them, don't use the trait anymore. The get() method of the view, which calls the get<Name>() method of the model (e.g. $this->get('Items')), still exists and works as before, but it doesn't fall back to reading a property of the view anymore. The set(), def(), getProperties() and setProperties() methods are not available anymore on models and views.
// Old:
$view->set('component_name', $value);
$value = $view->get('component_name');
$model->set('option', 'com_example');
// New:
$view->component_name = $value;
$value = $view->component_name;
$model->option = 'com_example';
To set the state of a model use $model->setState('name', $value) and $model->getState('name') as before.
Table
The core code doesn't use the methods of the trait on \Joomla\CMS\Table\Table objects anymore. Use ArrayHelper::fromObject() instead of getProperties() and access the properties directly instead of using get() and set().
// Old:
$properties = $table->getProperties(1);
$title = $table->get('title');
$table->set('title', 'New title');
// New:
use Joomla\Utilities\ArrayHelper;
$properties = ArrayHelper::fromObject($table, false);
$title = $table->title;
$table->title = 'New title';
User
The unused import of the trait has been removed from the \Joomla\CMS\User\User class. Read the properties of the user object directly, for example $user->name instead of $user->get('name'). See also the compat plugin section above for User::get().
Legacy onBeforeDelete and onAfterDelete events of the nested table removed
- PR: https://github.com/joomla/joomla-cms/pull/48637
- File: /libraries/src/Table/Nested.php
- Description:
Nested::delete()no longer dispatches the genericonBeforeDeleteandonAfterDeleteevents, which carried only the primary key. Listen to the typed table events instead, which every table dispatches, with the table assubjectand the samepk:
// Old:
public static function getSubscribedEvents(): array
{
return ['onBeforeDelete' => 'onBeforeDelete'];
}
public function onBeforeDelete(Event $event): void
{
$pk = $event->getArgument('pk');
}
// New:
public static function getSubscribedEvents(): array
{
return ['onTableBeforeDelete' => 'onTableBeforeDelete'];
}
public function onTableBeforeDelete(BeforeDeleteEvent $event): void
{
if (!$event->getArgument('subject') instanceof Nested) {
return;
}
$pk = $event->getArgument('pk');
}
The typed event fires for every table, so check the table in getArgument('subject') when only nested tables matter. The table events have no typed getters.