CacheException.php 497 Bytes
Newer Older
1 2 3 4
<?php

namespace Doctrine\DBAL\Cache;

5 6
use Doctrine\DBAL\DBALException;

7 8 9
/**
 * @psalm-immutable
 */
10
class CacheException extends DBALException
11
{
Benjamin Morel's avatar
Benjamin Morel committed
12
    /**
Grégoire Paris's avatar
Grégoire Paris committed
13
     * @return CacheException
Benjamin Morel's avatar
Benjamin Morel committed
14
     */
15
    public static function noCacheKey()
16
    {
17
        return new self('No cache key was set.');
18 19
    }

Benjamin Morel's avatar
Benjamin Morel committed
20
    /**
Grégoire Paris's avatar
Grégoire Paris committed
21
     * @return CacheException
Benjamin Morel's avatar
Benjamin Morel committed
22
     */
23
    public static function noResultDriverConfigured()
24
    {
25
        return new self('Trying to cache a query but no result driver is configured.');
26
    }
Benjamin Eberlei's avatar
Benjamin Eberlei committed
27
}