Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
47
src/Framework/Database/Events/EntityDeletedEvent.php
Normal file
47
src/Framework/Database/Events/EntityDeletedEvent.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Database\Events;
|
||||
|
||||
use App\Framework\Core\ValueObjects\Timestamp;
|
||||
|
||||
/**
|
||||
* Event that is fired when an entity is deleted
|
||||
*/
|
||||
final readonly class EntityDeletedEvent
|
||||
{
|
||||
public Timestamp $timestamp;
|
||||
|
||||
public function __construct(
|
||||
public object $entity,
|
||||
public string $entityClass,
|
||||
public mixed $entityId,
|
||||
public array $deletedData = [],
|
||||
?Timestamp $timestamp = null
|
||||
) {
|
||||
$this->timestamp = $timestamp ?? Timestamp::now();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this event is for a specific entity class
|
||||
*/
|
||||
public function isEntityOfType(string $expectedClass): bool
|
||||
{
|
||||
return $this->entityClass === $expectedClass || $this->entity instanceof $expectedClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get event metadata
|
||||
*/
|
||||
public function getEventData(): array
|
||||
{
|
||||
return [
|
||||
'event_type' => 'entity_deleted',
|
||||
'entity_class' => $this->entityClass,
|
||||
'entity_id' => $this->entityId,
|
||||
'timestamp' => $this->timestamp->toFloat(),
|
||||
'deleted_data' => $this->deletedData,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user