diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d75635..7814506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,3 +35,4 @@ - Add support for search query. - Add `EVENT_REGISTER_ELEMENT_TYPES` for defining custom element types. +- Change file and class name of `FieldTransformerEvent` to `RegisterFieldTransformersEvent`. diff --git a/src/events/FieldTransformerEvent.php b/src/events/RegisterFieldTransformersEvent.php similarity index 80% rename from src/events/FieldTransformerEvent.php rename to src/events/RegisterFieldTransformersEvent.php index 497b5be..ca9f56e 100644 --- a/src/events/FieldTransformerEvent.php +++ b/src/events/RegisterFieldTransformersEvent.php @@ -4,7 +4,7 @@ use craft\base\Event; -class FieldTransformerEvent extends Event +class RegisterFieldTransformersEvent extends Event { /** * @var array diff --git a/src/transformers/BaseTransformer.php b/src/transformers/BaseTransformer.php index 4daa944..b668a4a 100644 --- a/src/transformers/BaseTransformer.php +++ b/src/transformers/BaseTransformer.php @@ -7,7 +7,7 @@ use craft\base\ElementInterface; use craft\errors\ImageTransformException; use craft\errors\InvalidFieldException; -use samuelreichoer\queryapi\events\FieldTransformerEvent; +use samuelreichoer\queryapi\events\RegisterFieldTransformersEvent; use yii\base\InvalidConfigException; abstract class BaseTransformer extends Component @@ -346,7 +346,7 @@ protected function transformAddresses(array $addresses): array protected function registerCustomTransformers(): void { if ($this->hasEventHandlers(self::EVENT_REGISTER_FIELD_TRANSFORMERS)) { - $event = new FieldTransformerEvent(); + $event = new RegisterFieldTransformersEvent(); $this->trigger(self::EVENT_REGISTER_FIELD_TRANSFORMERS, $event); $this->customTransformers = $event->transformers; }