Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / lib / Doctrine / ORM / Internal / Hydration / HydrationException.php
1 <?php
2
3 namespace Doctrine\ORM\Internal\Hydration;
4
5 class HydrationException extends \Doctrine\ORM\ORMException
6 {
7     public static function nonUniqueResult()
8     {
9         return new self("The result returned by the query was not unique.");
10     }
11
12     public static function parentObjectOfRelationNotFound($alias, $parentAlias)
13     {
14         return new self("The parent object of entity result with alias '$alias' was not found."
15                 . " The parent alias is '$parentAlias'.");
16     }
17
18     public static function emptyDiscriminatorValue($dqlAlias)
19     {
20         return new self("The DQL alias '" . $dqlAlias . "' contains an entity ".
21             "of an inheritance hierachy with an empty discriminator value. This means " .
22             "that the database contains inconsistent data with an empty " .
23             "discriminator value in a table row."
24         );
25     }
26
27     /**
28      * @since 2.3
29      * @param   string $entityName
30      * @param   string $discrColumnName
31      * @param   string $dqlAlias
32      * @return  HydrationException
33      */
34     public static function missingDiscriminatorColumn($entityName, $discrColumnName, $dqlAlias)
35     {
36         return new self(sprintf(
37             'The discriminator column "%s" is missing for "%s" using the DQL alias "%s".',
38             $discrColumnName, $entityName, $dqlAlias
39         ));
40     }
41
42     /**
43      * @since 2.3
44      * @param   string $entityName
45      * @param   string $discrColumnName
46      * @param   string $dqlAlias
47      * @return  HydrationException
48      */
49     public static function missingDiscriminatorMetaMappingColumn($entityName, $discrColumnName, $dqlAlias)
50     {
51         return new self(sprintf(
52             'The meta mapping for the discriminator column "%s" is missing for "%s" using the DQL alias "%s".',
53             $discrColumnName, $entityName, $dqlAlias
54         ));
55     }
56 }