mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 11:24:31 +02:00
Started to move doctrine annotations to attributes (rector automated)
This commit is contained in:
parent
bb1285c35c
commit
0bc4699cdc
73 changed files with 483 additions and 604 deletions
|
@ -54,9 +54,8 @@ class AttachmentDeleteListener
|
|||
|
||||
/**
|
||||
* Removes the file associated with the attachment, if the file associated with the attachment changes.
|
||||
*
|
||||
* @PreUpdate
|
||||
*/
|
||||
#[PreUpdate]
|
||||
public function preUpdateHandler(Attachment $attachment, PreUpdateEventArgs $event): void
|
||||
{
|
||||
if ($event->hasChangedField('path')) {
|
||||
|
@ -81,9 +80,8 @@ class AttachmentDeleteListener
|
|||
|
||||
/**
|
||||
* Ensure that attachments are not used in preview, so that they can be deleted (without integrity violation).
|
||||
*
|
||||
* @ORM\PreRemove()
|
||||
*/
|
||||
#[ORM\PreRemove]
|
||||
public function preRemoveHandler(Attachment $attachment, PreRemoveEventArgs $event): void
|
||||
{
|
||||
//Ensure that the attachment that will be deleted, is not used as preview picture anymore...
|
||||
|
@ -109,9 +107,8 @@ class AttachmentDeleteListener
|
|||
|
||||
/**
|
||||
* Removes the file associated with the attachment, after the attachment was deleted.
|
||||
*
|
||||
* @PostRemove
|
||||
*/
|
||||
#[PostRemove]
|
||||
public function postRemoveHandler(Attachment $attachment, PostRemoveEventArgs $event): void
|
||||
{
|
||||
//Dont delete file if the attachment uses a builtin ressource:
|
||||
|
|
|
@ -44,11 +44,9 @@ class TreeCacheInvalidationListener
|
|||
$this->keyGenerator = $keyGenerator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ORM\PostUpdate()
|
||||
* @ORM\PostPersist()
|
||||
* @ORM\PostRemove()
|
||||
*/
|
||||
#[ORM\PostUpdate]
|
||||
#[ORM\PostPersist]
|
||||
#[ORM\PostRemove]
|
||||
public function invalidate(AbstractDBElement $element, LifecycleEventArgs $event): void
|
||||
{
|
||||
//If an element was changed, then invalidate all cached trees with this element class
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue