Trait Yiisoft\Db\Schema\Data\LazyArrayTrait
Provides a common implementation for Yiisoft\Db\Schema\Data\AbstractLazyArray, Yiisoft\Db\Schema\Data\AbstractStructuredLazyArray and Yiisoft\Db\Schema\Data\JsonLazyArray.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| count() | Yiisoft\Db\Schema\Data\LazyArrayTrait | |
| getIterator() | Yiisoft\Db\Schema\Data\LazyArrayTrait | |
| getRawValue() | The raw value that can be represented as: - a string retrieved value from the database that can be parsed into an array; - an array of values if the value is already parsed. | Yiisoft\Db\Schema\Data\LazyArrayTrait |
| getValue() | Returns parsed and typecasted value. | Yiisoft\Db\Schema\Data\LazyArrayTrait |
| jsonSerialize() | Yiisoft\Db\Schema\Data\LazyArrayTrait | |
| offsetExists() | Yiisoft\Db\Schema\Data\LazyArrayTrait | |
| offsetGet() | Yiisoft\Db\Schema\Data\LazyArrayTrait | |
| offsetSet() | Yiisoft\Db\Schema\Data\LazyArrayTrait | |
| offsetUnset() | Yiisoft\Db\Schema\Data\LazyArrayTrait | |
| prepareValue() | Prepares the value to be used as an array or throws an exception if it's impossible. | Yiisoft\Db\Schema\Data\LazyArrayTrait |
Method Details
| public count( ): integer |
public function count(): int
{
$this->prepareValue();
return count($this->value);
}
| public getIterator( ): ArrayIterator |
public function getIterator(): ArrayIterator
{
$this->prepareValue();
return new ArrayIterator($this->value);
}
The raw value that can be represented as: - a string retrieved value from the database that can be parsed into an array; - an array of values if the value is already parsed.
| public getRawValue( ): array|string |
public function getRawValue(): array|string
{
return $this->value;
}
Returns parsed and typecasted value.
| public getValue( ): array |
public function getValue(): array
{
$this->prepareValue();
return $this->value;
}
| public offsetExists( integer|string $offset ): boolean | ||
| $offset | integer|string |
The offset to check. |
public function offsetExists(mixed $offset): bool
{
$this->prepareValue();
return isset($this->value[$offset]);
}
| public offsetGet( integer|string $offset ): mixed | ||
| $offset | integer|string |
The offset to retrieve. |
public function offsetGet(mixed $offset): mixed
{
$this->prepareValue();
return $this->value[$offset];
}
| public offsetSet( integer|string $offset, mixed $value ): void | ||
| $offset | integer|string |
The offset to assign the value to. |
| $value | mixed | |
public function offsetSet(mixed $offset, mixed $value): void
{
$this->prepareValue();
$this->value[$offset] = $value;
}
| public offsetUnset( integer|string $offset ): void | ||
| $offset | integer|string |
The offset to unset. |
public function offsetUnset(mixed $offset): void
{
$this->prepareValue();
unset($this->value[$offset]);
}
Prepares the value to be used as an array or throws an exception if it's impossible.
| public prepareValue( ): void | ||
| return | void | |
|---|---|---|
Signup or Login in order to comment.