0 follower

Trait Yiisoft\ActiveRecord\Trait\ArrayIteratorTrait

Trait to implement 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 IteratorAggregate.

public getIterator( ): ArrayIterator
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 propertyValues( array|null $names, array $except ): array
$names array|null
$except array
return array