private function getSubset(FieldList $fields, $subset = array())
    {
        if (empty($subset)) {
            return $fields;
        }
        $subfieldlist = FieldList::create();
        foreach ($subset as $field) {
            if ($field = $fields->fieldByName($field)) {
                $subfieldlist->push($field);
            }
        }
        return $subfieldlist;
    }
private function getSubset(FieldList $fields, $subset = array())
    {
        if (empty($subset)) {
            return $fields;
        }
        $subfieldlist = FieldList::create();
        foreach ($subset as $field) {
            if ($field = $fields->fieldByName($field)) {
                $subfieldlist->push($field);
            }
        }
        return $subfieldlist;
    }
private function getSubset ( FieldList $ fields , $ subset = array ( ) ) { if ( empty ( $ subset ) ) { return $ fields ; } $ subfieldlist = FieldList :: create ( ) ; foreach ( $ subset as $ field ) { if ( $ field = $ fields -> fieldByName ( $ field ) ) { $ subfieldlist -> push ( $ field ) ; } } return $ subfieldlist ; }
Helper function for reducing a field set to a given subset,
in the given order.

@param FieldList $fields form fields to take a subset from.
@param array     $subset list of field names to return as subset

@return FieldList subset of form fields
Helper function for reducing a field set to a given subset in the given order .