src/Bridge/Doctrine/EventListener/PurgeHttpCacheListener.php
public function preUpdate(PreUpdateEventArgs $eventArgs): void
    {
        $object = $eventArgs->getObject();
        $this->gatherResourceAndItemTags($object, true);

        $changeSet = $eventArgs->getEntityChangeSet();
        $associationMappings = $eventArgs->getEntityManager()->getClassMetadata(ClassUtils::getClass($eventArgs->getObject()))->getAssociationMappings();

        foreach ($changeSet as $key => $value) {
            if (!isset($associationMappings[$key])) {
                continue;
            }

            $this->addTagsFor($value[0]);
            $this->addTagsFor($value[1]);
        }
    }
public function preUpdate(PreUpdateEventArgs $eventArgs): void
    {
        $object = $eventArgs->getObject();
        $this->gatherResourceAndItemTags($object, true);

        $changeSet = $eventArgs->getEntityChangeSet();
        $associationMappings = $eventArgs->getEntityManager()->getClassMetadata(ClassUtils::getClass($eventArgs->getObject()))->getAssociationMappings();

        foreach ($changeSet as $key => $value) {
            if (!isset($associationMappings[$key])) {
                continue;
            }

            $this->addTagsFor($value[0]);
            $this->addTagsFor($value[1]);
        }
    }
public function preUpdate ( PreUpdateEventArgs $ eventArgs ) : void { $ object = $ eventArgs -> getObject ( ) ; $ this -> gatherResourceAndItemTags ( $ object , true ) ; $ changeSet = $ eventArgs -> getEntityChangeSet ( ) ; $ associationMappings = $ eventArgs -> getEntityManager ( ) -> getClassMetadata ( ClassUtils :: getClass ( $ eventArgs -> getObject ( ) ) ) -> getAssociationMappings ( ) ; foreach ( $ changeSet as $ key => $ value ) { if ( ! isset ( $ associationMappings [ $ key ] ) ) { continue ; } $ this -> addTagsFor ( $ value [ 0 ] ) ; $ this -> addTagsFor ( $ value [ 1 ] ) ; } }
Collects tags from the previous and the current version of the updated entities to purge related documents.
Collects tags from the previous and the current version of the updated entities to purge related documents .