Completed
Push — develop ( 72ba3e...de019a )
by Marco
25s queued 12s
created

ShardingException::activeTransaction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Doctrine\DBAL\Sharding;
4
5
use Doctrine\DBAL\DBALException;
6
7
/**
8
 * Sharding related Exceptions
9
 */
10
class ShardingException extends DBALException
11
{
12
    /**
13
     * @return \Doctrine\DBAL\Sharding\ShardingException
14
     */
15
    public static function notImplemented()
16
    {
17
        return new self('This functionality is not implemented with this sharding provider.', 1331557937);
18
    }
19
20
    /**
21
     * @return \Doctrine\DBAL\Sharding\ShardingException
22
     */
23 97
    public static function missingDefaultFederationName()
24
    {
25 97
        return new self('SQLAzure requires a federation name to be set during sharding configuration.', 1332141280);
26
    }
27
28
    /**
29
     * @return \Doctrine\DBAL\Sharding\ShardingException
30
     */
31 73
    public static function missingDefaultDistributionKey()
32
    {
33 73
        return new self('SQLAzure requires a distribution key to be set during sharding configuration.', 1332141329);
34
    }
35
36
    /**
37
     * @return \Doctrine\DBAL\Sharding\ShardingException
38
     */
39 50
    public static function activeTransaction()
40
    {
41 50
        return new self('Cannot switch shard during an active transaction.', 1332141766);
42
    }
43
44
    /**
45
     * @return \Doctrine\DBAL\Sharding\ShardingException
46
     */
47
    public static function noShardDistributionValue()
48
    {
49
        return new self('You have to specify a string or integer as shard distribution value.', 1332142103);
50
    }
51
52
    /**
53
     * @return \Doctrine\DBAL\Sharding\ShardingException
54
     */
55 73
    public static function missingDistributionType()
56
    {
57 73
        return new self("You have to specify a sharding distribution type such as 'integer', 'string', 'guid'.");
58
    }
59
}
60