namespace Civi\Api4\Event;
+/**
+ * @deprecated
+ */
class Events {
/**
- * Build the database schema, allow adding of custom joins and tables.
+ * @deprecated
+ * Just use the string instead of the constant when listening for this event
*/
const SCHEMA_MAP_BUILD = 'api.schema_map.build';
/**
- * Add back POST_SELECT_QUERY const due to Joomla upgrade failure
+ * @deprecated
+ * Unused - there is no longer an event with this name
* https://lab.civicrm.org/dev/joomla/-/issues/28#note_39487
*/
const POST_SELECT_QUERY = 'api.select_query.post';
namespace Civi\Api4\Event\Subscriber;
-use Civi\Api4\Event\Events;
use Civi\Api4\Event\SchemaMapBuildEvent;
use Civi\Api4\Service\Schema\Joinable\ExtraJoinable;
use Civi\Api4\Service\Schema\Joinable\Joinable;
*/
public static function getSubscribedEvents() {
return [
- Events::SCHEMA_MAP_BUILD => 'onSchemaBuild',
+ 'api.schema_map.build' => 'onSchemaBuild',
];
}
namespace Civi\Api4\Event\Subscriber;
-use Civi\Api4\Event\Events;
use Civi\Api4\Event\SchemaMapBuildEvent;
use Civi\Api4\Service\Schema\Joinable\Joinable;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
*/
public static function getSubscribedEvents() {
return [
- Events::SCHEMA_MAP_BUILD => 'onSchemaBuild',
+ 'api.schema_map.build' => 'onSchemaBuild',
];
}
namespace Civi\Api4\Event\Subscriber;
-use Civi\Api4\Event\Events;
use Civi\Api4\Event\SchemaMapBuildEvent;
use Civi\Api4\Service\Schema\Joinable\Joinable;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
*/
public static function getSubscribedEvents() {
return [
- Events::SCHEMA_MAP_BUILD => 'onSchemaBuild',
+ 'api.schema_map.build' => 'onSchemaBuild',
];
}
namespace Civi\Api4\Service\Schema;
use Civi\Api4\Entity;
-use Civi\Api4\Event\Events;
use Civi\Api4\Event\SchemaMapBuildEvent;
use Civi\Api4\Service\Schema\Joinable\CustomGroupJoinable;
use Civi\Api4\Service\Schema\Joinable\Joinable;
$this->loadTables($map);
$event = new SchemaMapBuildEvent($map);
- $this->dispatcher->dispatch(Events::SCHEMA_MAP_BUILD, $event);
+ $this->dispatcher->dispatch('api.schema_map.build', $event);
return $map;
}