I have been implementing my own module like this;
protected function myFunction()
{
Event::on(
ElementQuery::class,
ElementQuery::EVENT_BEFORE_PREPARE,
function(Event $event) {
if ($event->sender->elementType === 'craft\elements\Asset')
{
// DO SOMETHING...
However, I do not want to perform this function when an entry is saved. It seems that EVENT_BEFORE_PREPARE
is triggered when I save an entry. So, is it possible to detect if the event is saving an entry or not?