private function prepareFields(array $fields)
    {
        $include = null;
        foreach ($fields as $key => $type) {
            $type = (bool) $type;
            if (null === $include) {
                $include = $type;
            }
            if ($type !== $include) {
                PersisterException::badRequest('Field projection mismatch. You cannot both exclude and include fields.');
            }
            $fields[$key] = $type;
        }
        return [$fields, $include];
    }
private function prepareFields(array $fields)
    {
        $include = null;
        foreach ($fields as $key => $type) {
            $type = (bool) $type;
            if (null === $include) {
                $include = $type;
            }
            if ($type !== $include) {
                PersisterException::badRequest('Field projection mismatch. You cannot both exclude and include fields.');
            }
            $fields[$key] = $type;
        }
        return [$fields, $include];
    }
private function prepareFields ( array $ fields ) { $ include = null ; foreach ( $ fields as $ key => $ type ) { $ type = ( bool ) $ type ; if ( null === $ include ) { $ include = $ type ; } if ( $ type !== $ include ) { PersisterException :: badRequest ( 'Field projection mismatch. You cannot both exclude and include fields.' ) ; } $ fields [ $ key ] = $ type ; } return [ $ fields , $ include ] ; }
Prepares projection fields for a query and returns as a tuple.

@param   array   $fields
@return  array
@throws  PersisterException
Prepares projection fields for a query and returns as a tuple .