Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Cache Invalidator Bundle Laravel Package

easytek/doctrine-cache-invalidator-bundle

View on GitHub
Deep Wiki
Context7

DoctrineCacheInvalidationBundle

Invalidate your doctrine cache easily.

This bundle is still a work in progress.

ToDo

  • Define the invalidations rules in the bundle configuration instead of a class ?
  • Add some tests.
  • Add Doctrine 2.3 wildcard invalidation syntax.

Install

composer require "easytek/doctrine-cache-invalidator-bundle" "dev-master"

Use

Create this service :

<?php

namespace You\YourBundle\Cache;

use Easytek\DoctrineCacheInvalidatorBundle\Cache\CacheInvalidationInterface;

class CacheInvalidation implements CacheInvalidationInterface
{
    public function getClasses()
    {
        retun array();
    }
}

Then you add it in your services file configuration :

    you.yourbundle.cache_invalidation:
        class: You\YourBundle\Cache\CacheInvalidation
        tags:
            - { name: easytek.doctrine_cache_invalidation }

Then you have to fill the array returned by the getClasses method of your service. The array contains a key for each doctrine entity class you want to work on. This key is associated with an array of invalidation rules, each invalidation rule is also an array, containing the two following informations :

  • The cache id pattern, which can contain {attribute}, the same way you do in Twig.
  • The entity changes triggering the invalidation, it can be "insert", "update", "delete" or "*" wich regroup the first three.

Example :

// ...
    public function getClasses()
    {
        return array(
            'You\YourBundle\Entity\Category' => array(
                array(
                    'pattern' => 'category_{id}',
                    'changes' => array('*')
                )
            )
        )
    }

This means, when a Category entity will be either inserted, updated or deleted, the cache id 'category_{id}' (where {id} is replaced by $category->getId()) will be cleared.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver