Trait Yiisoft\ActiveRecord\Trait\ArrayIteratorTrait
Trait to implement {@see IteratorAggregate} interface for ActiveRecord.
See also \
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getIterator() | Returns an iterator for traversing the properties in the ActiveRecord. | Yiisoft\ |
| propertyValues() | Yiisoft\ |
Method Details
Returns an iterator for traversing the properties in the ActiveRecord.
This method is required by the interface {@see \
| public ArrayIterator getIterator ( ) | ||
| return | ArrayIterator |
An iterator for traversing the items in the list. |
|---|---|---|
public function getIterator(): ArrayIterator
{
$values = $this->propertyValues();
return new ArrayIterator($values);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.