AuditLog
in package
Trace d'audit immuable d'une action sensible réalisée sur un compte ou une carte.
Chaque entrée est écrite exclusivement par le service AuditLogger, qui
persiste puis flushe immédiatement l'entité au moment de l'action ; aucun autre code du
projet n'instancie AuditLog. targetUser et actorUser sont deux relations
ManyToOne facultatives vers User (SET NULL à la suppression du compte), doublées
de targetLabel et actorLabel qui figent un libellé lisible au moment de l'écriture — ils
restent donc exploitables même après anonymisation ou suppression de l'utilisateur concerné.
actionType reprend l'une des constantes ACTION_* de la classe, et metadata porte un
contexte libre au format JSON. Les enregistrements ne sont ni modifiés ni purgés
automatiquement après création : ils sont conservés indéfiniment, aucune tâche planifiée de
purge n'ayant été trouvée dans le projet.
Attributes
- #[Entity]
- $repositoryClass: \App\Repository\AuditLogRepository::class
- #[Index]
- $columns: ['created_at']
- $name: 'IDX_AUDIT_LOG_CREATED_AT'
- #[Index]
- $columns: ['target_user_id', 'created_at']
- $name: 'IDX_AUDIT_LOG_TARGET_CREATED'
Table of Contents
Constants
- ACTION_ORDER_STATUS_UPDATED : mixed = 'order.status_updated'
- ACTION_SUBSCRIPTION_ACTIVATED : mixed = 'subscription.activated'
- ACTION_SUBSCRIPTION_CREATED : mixed = 'subscription.created'
- ACTION_USER_ACTIVATED : mixed = 'user.activated'
- ACTION_USER_CREATED : mixed = 'user.created'
- ACTION_USER_DEACTIVATED : mixed = 'user.deactivated'
- ACTION_USER_DELETED : mixed = 'user.deleted'
- ACTION_USER_UPDATED : mixed = 'user.updated'
- ACTION_VCARD_CREATED : mixed = 'virtual_card.created'
- ACTION_VCARD_DELETED : mixed = 'virtual_card.deleted'
- ACTION_VCARD_UPDATED : mixed = 'virtual_card.updated'
Properties
- $actionType : string
- $actorLabel : string|null
- $actorUser : User|null
- $createdAt : DateTimeImmutable
- $id : int|null
- $metadata : array<string|int, mixed>|null
- $targetLabel : string|null
- $targetUser : User|null
Methods
- __construct() : mixed
- getActionType() : string
- getActorLabel() : string|null
- getActorUser() : User|null
- getCreatedAt() : DateTimeImmutable
- getId() : int|null
- getMetadata() : array<string|int, mixed>|null
- getTargetLabel() : string|null
- getTargetUser() : User|null
- setActionType() : self
- setActorLabel() : self
- setActorUser() : self
- setCreatedAt() : self
- setMetadata() : self
- setTargetLabel() : self
- setTargetUser() : self
Constants
ACTION_ORDER_STATUS_UPDATED
public
mixed
ACTION_ORDER_STATUS_UPDATED
= 'order.status_updated'
ACTION_SUBSCRIPTION_ACTIVATED
public
mixed
ACTION_SUBSCRIPTION_ACTIVATED
= 'subscription.activated'
ACTION_SUBSCRIPTION_CREATED
public
mixed
ACTION_SUBSCRIPTION_CREATED
= 'subscription.created'
ACTION_USER_ACTIVATED
public
mixed
ACTION_USER_ACTIVATED
= 'user.activated'
ACTION_USER_CREATED
public
mixed
ACTION_USER_CREATED
= 'user.created'
ACTION_USER_DEACTIVATED
public
mixed
ACTION_USER_DEACTIVATED
= 'user.deactivated'
ACTION_USER_DELETED
public
mixed
ACTION_USER_DELETED
= 'user.deleted'
ACTION_USER_UPDATED
public
mixed
ACTION_USER_UPDATED
= 'user.updated'
ACTION_VCARD_CREATED
public
mixed
ACTION_VCARD_CREATED
= 'virtual_card.created'
ACTION_VCARD_DELETED
public
mixed
ACTION_VCARD_DELETED
= 'virtual_card.deleted'
ACTION_VCARD_UPDATED
public
mixed
ACTION_VCARD_UPDATED
= 'virtual_card.updated'
Properties
$actionType
private
string
$actionType
Attributes
- #[Column]
- $name: 'action_type'
- $length: 64
$actorLabel
private
string|null
$actorLabel
= null
Attributes
- #[Column]
- $name: 'actor_label'
- $length: 255
- $nullable: true
$actorUser
private
User|null
$actorUser
= null
Attributes
- #[JoinColumn]
- $onDelete: 'SET NULL'
- $nullable: true
- #[ManyToOne]
- $targetEntity: \App\Entity\User::class
$createdAt
private
DateTimeImmutable
$createdAt
Attributes
- #[Column]
- $name: 'created_at'
- $type: 'datetime_immutable'
$id
private
int|null
$id
= null
Attributes
- #[Column]
- #[GeneratedValue]
- #[Id]
$metadata
private
array<string|int, mixed>|null
$metadata
= null
Attributes
- #[Column]
- $type: 'json'
- $nullable: true
$targetLabel
private
string|null
$targetLabel
= null
Attributes
- #[Column]
- $name: 'target_label'
- $length: 255
- $nullable: true
$targetUser
private
User|null
$targetUser
= null
Attributes
- #[JoinColumn]
- $onDelete: 'SET NULL'
- $nullable: true
- #[ManyToOne]
- $targetEntity: \App\Entity\User::class
Methods
__construct()
public
__construct(string $actionType) : mixed
Parameters
- $actionType : string
getActionType()
public
getActionType() : string
Return values
stringgetActorLabel()
public
getActorLabel() : string|null
Return values
string|nullgetActorUser()
public
getActorUser() : User|null
Return values
User|nullgetCreatedAt()
public
getCreatedAt() : DateTimeImmutable
Return values
DateTimeImmutablegetId()
public
getId() : int|null
Return values
int|nullgetMetadata()
public
getMetadata() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetTargetLabel()
public
getTargetLabel() : string|null
Return values
string|nullgetTargetUser()
public
getTargetUser() : User|null
Return values
User|nullsetActionType()
public
setActionType(string $actionType) : self
Parameters
- $actionType : string
Return values
selfsetActorLabel()
public
setActorLabel(string|null $actorLabel) : self
Parameters
- $actorLabel : string|null
Return values
selfsetActorUser()
public
setActorUser(User|null $actorUser) : self
Parameters
- $actorUser : User|null
Return values
selfsetCreatedAt()
public
setCreatedAt(DateTimeImmutable $createdAt) : self
Parameters
- $createdAt : DateTimeImmutable
Return values
selfsetMetadata()
public
setMetadata(array<string|int, mixed>|null $metadata) : self
Parameters
- $metadata : array<string|int, mixed>|null
Return values
selfsetTargetLabel()
public
setTargetLabel(string|null $targetLabel) : self
Parameters
- $targetLabel : string|null
Return values
selfsetTargetUser()
public
setTargetUser(User|null $targetUser) : self
Parameters
- $targetUser : User|null