DbRefResolver<T>
Resolves DbRef objects
Instance Methods
| Returns | Signature and Description |
|---|---|
bool | isResolvable()Gets whether or not this class supports the reference type. |
?T | Resolves a MongoDB DbRef. |
Traversable<T> | resolveAll()Resolves a MongoDB DbRef. |
Method Details
isResolvable
abstract public function
isResolvable(string $ref)Gets whether or not this class supports the reference type.
| Name | Type | Description |
|---|---|---|
$ref | string | The reference type (usually a MongoDB collection name) |
| Type | Description |
|---|---|
bool |
|
resolve
abstract public function
resolve(DbRef $ref)Resolves a MongoDB DbRef.
| Name | Type | Description |
|---|---|---|
$ref | DbRef | The DbRef to load |
| Type | Description |
|---|---|
?T | The loaded entity or |
| Type | Conditions |
|---|---|
InvalidArgumentException | If |
Unreachable | If the connection fails |
Unretrievable | If the result cannot be retrieved |
Generic | If any other database problem occurs |
resolveAll
abstract public function
resolveAll(Traversable<DbRef> $refs)Resolves a MongoDB DbRef.
| Name | Type | Description |
|---|---|---|
$refs | Traversable<DbRef> | The DbRefs to load |
| Type | Description |
|---|---|
Traversable<T> | The loaded entities |
| Type | Conditions |
|---|---|
InvalidArgumentException | If any |
Unreachable | If the connection fails |
Unretrievable | If the result cannot be retrieved |
Generic | If any other database problem occurs |