public function refineCollection($raw, $retainKey = false)
    {
        $refined = [];

        foreach ($raw as $key => $item) {
            if ($retainKey) {
                $this->key = $key;
                $refined[ $key ] = $this->refineItem($item);
            } else {
                $refined[] = $this->refineItem($item);
            }
        }

        return $refined;
    }
public function refineCollection($raw, $retainKey = false)
    {
        $refined = [];

        foreach ($raw as $key => $item) {
            if ($retainKey) {
                $this->key = $key;
                $refined[ $key ] = $this->refineItem($item);
            } else {
                $refined[] = $this->refineItem($item);
            }
        }

        return $refined;
    }
public function refineCollection ( $ raw , $ retainKey = false ) { $ refined = [ ] ; foreach ( $ raw as $ key => $ item ) { if ( $ retainKey ) { $ this -> key = $ key ; $ refined [ $ key ] = $ this -> refineItem ( $ item ) ; } else { $ refined [ ] = $ this -> refineItem ( $ item ) ; } } return $ refined ; }
Refine a collection of raw items.

@param mixed $raw
@param boolean $retainKey
@return array
Refine a collection of raw items .