Skip to content

Commit

Permalink
Deprecate "civi.api4.createRequest" event listener
Browse files Browse the repository at this point in the history
The "civi.api4.createRequest" event will be removed in CiviCRM Core, see civicrm/civicrm-core#23311. The "civi.api4.entityTypes" event provides all necessary information.
  • Loading branch information
jensschuppe committed Apr 27, 2022
1 parent f1ea640 commit d1cf2d5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Civi/Eck/API/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class Entity implements API_ProviderInterface, EventSubscriberInterface {
*/
public static function getSubscribedEvents():array {
return [
// TODO: "civi.api4.createRequest" will be removed in CiviCRM Core, see
// https://github.com/civicrm/civicrm-core/pull/23311.
// The "civi.api4.entityTypes" event provides all necessary
// information.
'civi.api4.createRequest' => [['onApi4CreateRequest', Events::W_EARLY]],
'civi.api4.entityTypes' => [['onApi4EntityTypes', Events::W_EARLY]],
];
Expand Down Expand Up @@ -84,6 +88,11 @@ public function onApi4EntityTypes(GenericHookEvent $event) {
* Callback for `civi.api4.createRequest` event.
*
* @param CreateApi4RequestEvent $event
*
* @deprecated
* The "civi.api4.createRequest" event will be removed in CiviCRM Core, see
* https://github.com/civicrm/civicrm-core/pull/23311.
* The "civi.api4.entityTypes" event provides all necessary information.
*/
public function onApi4CreateRequest(CreateApi4RequestEvent $event) {
if (strpos($event->entityName, 'Eck_') === 0) {
Expand Down

0 comments on commit d1cf2d5

Please sign in to comment.