Skip to main content
Version: Next

Pimcore Studio Events

The Data Quality Management bundle implements the Pimcore Studio Backend Bundle and dispatches Symfony events before returning certain Studio Backend responses.

warning

The Studio Backend REST endpoints backing these responses are @internal and can change without notice; do not call them directly. Subscribe to the pre-response events below instead, following the general Additional and Custom Attributes pattern used across Studio Backend.

The event classes and their payload schemas are themselves marked @internal, so their typed fields can change between releases. Read them for context, but treat only the additional-attribute API as stable.

What subscribers can change

Every event extends AbstractPreResponseEvent, which exposes a single mutation surface, the response object's additional attributes:

  • hasAdditionalAttribute(string $key): bool
  • getAdditionalAttribute(string $key): mixed
  • addAdditionalAttribute(string $key, mixed $value): void
  • removeAdditionalAttribute(string $key): void

The payload objects themselves are immutable: their properties are readonly and they expose getters only. A subscriber can enrich a response with extra keys, or drop keys another subscriber added, but it cannot overwrite the typed fields (mark, score, rules, and so on) that the bundle computed.

Available events

Event nameEvent classDispatched when
pre_response.data_quality.class_recommended_fieldStudioRecommendedFieldOnce per candidate field while building the "Recommended Fields" picker in the class editor.
pre_response.data_quality.list_color_settingsStudioColorSettingsOnce per configured mark while building the color settings used to render score badges in Pimcore Studio.
pre_response.data_quality.detail_widgetDetailWidgetDataOnce per data quality field while building the "Data Quality Details" tab content for an object.
pre_response.data_quality.symfony_expression_validationSymfonyExpressionValidationAfter validating a Symfony Expression (used for the class Precondition field and the Symfony Expression Check rule).

All event classes live under Pimcore\Bundle\DataQualityManagementBundle\Event\PreResponse.

StudioRecommendedField

Payload accessor: getRecommendedField(), returning a RecommendedField with:

  • getKey(): string - the field key (for example series).
  • getName(): string - the constructed field name (for example Series [series]).

StudioColorSettings

Payload accessor: getColorSettings(), returning a ColorSettings with:

  • getMark(): string - the rating mark (for example A).
  • getFontColor(): string - hex code of the mark's font color.
  • getBackgroundColor(): string - hex code of the mark's background color.

DetailWidgetData

Payload accessor: getDetailWidget(), returning a DetailWidget with:

  • getName(): string - the data quality field name.
  • getTitle(): string - the data quality field title.
  • getMark(): ?string - the resulting mark for the field.
  • getScore(): ?float - the resulting score for the field.
  • getRules(): RuleData[] - one entry per configured rule, each with getTitle(), getSuggestion() and isValid().
  • getLastUpdated(): ?int - Unix timestamp of the last score calculation.

SymfonyExpressionValidation

Payload accessor: getValidation(), returning a SymfonyExpressionValidation schema object with:

  • isValid(): bool - whether the expression is syntactically and semantically valid.
  • getMessage(): ?string - the validation error message, if invalid.

Example: adding a custom attribute

<?php
declare(strict_types=1);

namespace App\EventSubscriber;

use Pimcore\Bundle\DataQualityManagementBundle\Event\PreResponse\DetailWidgetData;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

final class DataQualityDetailWidgetSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
DetailWidgetData::EVENT_NAME => 'onDetailWidget',
];
}

public function onDetailWidget(DetailWidgetData $event): void
{
$widget = $event->getDetailWidget();

$event->addAdditionalAttribute('isCritical', $widget->getMark() === 'D');
}
}