Final Class Yiisoft\Hydrator\Result
| Inheritance | Yiisoft\Hydrator\Result |
|---|
The result object that provides whether the value is resolved or not, and the value itself.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| fail() | Creates instance of Result without value. |
Yiisoft\Hydrator\Result |
| getValue() | Returns the resolved value. | Yiisoft\Hydrator\Result |
| isResolved() | Yiisoft\Hydrator\Result | |
| success() | Creates instance of Result with resolved value. |
Yiisoft\Hydrator\Result |
Method Details
Creates instance of Result without value.
| public static self fail ( ) | ||
| return | self |
The result object. |
|---|---|---|
public static function fail(): self
{
return new self(false);
}
Returns the resolved value.
When the value is not resolved, this method returns null.
Since null can be a valid value as well, please use {@see \Yiisoft\Hydrator\isResolved()} to check
if the value is resolved or not.
| public mixed getValue ( ) | ||
| return | mixed |
The resolved value. |
|---|---|---|
public function getValue(): mixed
{
return $this->value;
}
| public boolean isResolved ( ) | ||
| return | boolean |
Whether the value is resolved. |
|---|---|---|
public function isResolved(): bool
{
return $this->isResolved;
}
Signup or Login in order to comment.