public function flatten($indexColumn, $valueColumn)
    {
        return $this->reduce(
            function ($carry, CollectionableInterface $entity) use ($indexColumn, $valueColumn) {
                $carry[$this->getFieldValue($entity, $indexColumn)] = $this->getFieldValue($entity, $valueColumn);

                return $carry;
            },
            array()
        );
    }
public function flatten($indexColumn, $valueColumn)
    {
        return $this->reduce(
            function ($carry, CollectionableInterface $entity) use ($indexColumn, $valueColumn) {
                $carry[$this->getFieldValue($entity, $indexColumn)] = $this->getFieldValue($entity, $valueColumn);

                return $carry;
            },
            array()
        );
    }
public function flatten ( $ indexColumn , $ valueColumn ) { return $ this -> reduce ( function ( $ carry , CollectionableInterface $ entity ) use ( $ indexColumn , $ valueColumn ) { $ carry [ $ this -> getFieldValue ( $ entity , $ indexColumn ) ] = $ this -> getFieldValue ( $ entity , $ valueColumn ) ; return $ carry ; } , array ( ) ) ; }
Create a flattened view of collection as a key value array.

@param string $indexColumn
@param string $valueColumn

@return array
Create a flattened view of collection as a key value array .