Skip to content

Commit

Permalink
Change file and class name of FieldTransformerEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelreichor committed Dec 30, 2024
1 parent 99c0d8b commit a66236f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use craft\base\Event;

class FieldTransformerEvent extends Event
class RegisterFieldTransformersEvent extends Event
{
/**
* @var array<int, array{fieldClass: string, transformer: class-string}>
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/BaseTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a66236f

Please sign in to comment.