Final Class Yiisoft\Hydrator\Result
| Inheritance | Yiisoft\ |
|---|
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\ |
| getValue() | Returns the resolved value. | Yiisoft\ |
| isResolved() | Yiisoft\ |
|
| success() | Creates instance of Result with resolved value. |
Yiisoft\ |
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 \
| 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;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.