1 | <?php |
||
21 | class MongoDBException extends Exception |
||
22 | { |
||
23 | public static function detachedDocumentCannotBeRemoved() : self |
||
24 | { |
||
25 | return new self('Detached document cannot be removed'); |
||
26 | } |
||
27 | |||
28 | public static function invalidDocumentState(int $state) : self |
||
29 | { |
||
30 | return new self(sprintf('Invalid document state "%s"', $state)); |
||
31 | } |
||
32 | |||
33 | public static function documentNotMappedToCollection(string $className) : self |
||
34 | { |
||
35 | return new self(sprintf('The "%s" document is not mapped to a MongoDB database collection.', $className)); |
||
36 | } |
||
37 | |||
38 | 5 | public static function documentManagerClosed() : self |
|
39 | { |
||
40 | 5 | return new self('The DocumentManager is closed.'); |
|
41 | } |
||
42 | |||
43 | public static function unknownDocumentNamespace(string $documentNamespaceAlias) : self |
||
47 | |||
48 | 1 | public static function cannotPersistMappedSuperclass(string $className) : self |
|
49 | { |
||
50 | 1 | return new self(sprintf('Cannot persist object of class "%s" as it is not a persistable document.', $className)); |
|
51 | } |
||
52 | |||
53 | public static function invalidDocumentRepository(string $className) : self |
||
57 | |||
58 | public static function invalidGridFSRepository(string $className) : self |
||
62 | |||
63 | /** |
||
64 | * @param string|array $expected |
||
65 | * @param mixed $got |
||
66 | * |
||
67 | * @return MongoDBException |
||
68 | */ |
||
69 | 4 | public static function invalidValueForType(string $type, $expected, $got) : self |
|
88 | |||
89 | 2 | public static function shardKeyFieldCannotBeChanged(string $field, string $className) : self |
|
93 | |||
94 | public static function shardKeyFieldMissing(string $field, string $className) : self |
||
98 | |||
99 | public static function failedToEnableSharding(string $dbName, string $errorMessage) : self |
||
107 | |||
108 | 1 | public static function failedToEnsureDocumentSharding(string $className, string $errorMessage) : self |
|
116 | |||
117 | public static function commitInProgress() : self |
||
121 | |||
122 | public static function documentBucketOnlyAvailableForGridFSFiles(string $className) : self |
||
126 | |||
127 | 1 | public static function cannotPersistGridFSFile(string $className) : self |
|
131 | |||
132 | public static function cannotReadGridFSSourceFile(string $filename) : self |
||
136 | |||
137 | 3 | public static function invalidTypeMap(string $part, string $epectedType) : self |
|
141 | |||
142 | public static function cannotRefreshDocument() : self |
||
146 | |||
147 | public static function cannotCreateRepository(string $className) : self |
||
151 | } |
||
152 |