src/Forms/SelectField.php
protected function getListMap($source)
    {
        // Extract source as an array
        if ($source instanceof SS_List) {
            $source = $source->map();
        }
        if ($source instanceof Map) {
            $source = $source->toArray();
        }
        if (!is_array($source) && !($source instanceof ArrayAccess)) {
            user_error('$source passed in as invalid type', E_USER_ERROR);
        }

        return $source;
    }
protected function getListMap($source)
    {
        // Extract source as an array
        if ($source instanceof SS_List) {
            $source = $source->map();
        }
        if ($source instanceof Map) {
            $source = $source->toArray();
        }
        if (!is_array($source) && !($source instanceof ArrayAccess)) {
            user_error('$source passed in as invalid type', E_USER_ERROR);
        }

        return $source;
    }
protected function getListMap ( $ source ) { // Extract source as an array if ( $ source instanceof SS_List ) { $ source = $ source -> map ( ) ; } if ( $ source instanceof Map ) { $ source = $ source -> toArray ( ) ; } if ( ! is_array ( $ source ) && ! ( $ source instanceof ArrayAccess ) ) { user_error ( '$source passed in as invalid type' , E_USER_ERROR ) ; } return $ source ; }
Given a list of values, extract the associative map of id => title

@param mixed $source
@return array Associative array of ids and titles
Given a list of values extract the associative map of id = > title