0 follower

Trait Yiisoft\ActiveRecord\Trait\ArrayIteratorTrait

Trait to implement {@see IteratorAggregate} interface for ActiveRecord.

See also \Yiisoft\ActiveRecord\Trait\ActiveRecordInterface::propertyValues().

Public Methods

Hide inherited methods

Method Description Defined By
getIterator() Returns an iterator for traversing the properties in the ActiveRecord. Yiisoft\ActiveRecord\Trait\ArrayIteratorTrait
propertyValues() Yiisoft\ActiveRecord\Trait\ArrayIteratorTrait

Method Details

Hide inherited methods

getIterator() public method

Returns an iterator for traversing the properties in the ActiveRecord.

This method is required by the interface {@see \IteratorAggregate}.

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);
}

            
propertyValues() public method

public array propertyValues ( array|null $names, array $except )
$names array|null
$except array
return array