src/Filter/DataFilter.php
public function filter(array $data): array
    {
        /* @var array|DataInterface[] $result */
        $result = [];
        foreach ($data as $item) {
            $key = implode('|', $item->getKeys());
            if (!isset($result[$key]) || $result[$key]->getOrder() < $item->getOrder()) {
                $result[$key] = $item;
            }
        }
        return array_values($result);
    }
public function filter(array $data): array
    {
        /* @var array|DataInterface[] $result */
        $result = [];
        foreach ($data as $item) {
            $key = implode('|', $item->getKeys());
            if (!isset($result[$key]) || $result[$key]->getOrder() < $item->getOrder()) {
                $result[$key] = $item;
            }
        }
        return array_values($result);
    }
public function filter ( array $ data ) : array { /* @var array|DataInterface[] $result */ $ result = [ ] ; foreach ( $ data as $ item ) { $ key = implode ( '|' , $ item -> getKeys ( ) ) ; if ( ! isset ( $ result [ $ key ] ) || $ result [ $ key ] -> getOrder ( ) < $ item -> getOrder ( ) ) { $ result [ $ key ] = $ item ; } } return array_values ( $ result ) ; }
Filters the data to only contain the items with the highest order.
@param array|DataInterface[] $data
@return array|DataInterface[]
Filters the data to only contain the items with the highest order .