private function filterRecordEditingFields(FieldList $fields, $id)
    {
        $config = $this->component->getConfig();
        $editableFields = $config['editableFields'];

        // get all dataFields or just the ones allowed in config
        if ($editableFields) {
            $dataFields = array();

            foreach ($editableFields as $fieldName) {
                $dataFields[$fieldName] = $fields->dataFieldByName($fieldName);
            }
        } else {
            $dataFields = $fields->dataFields();
        }

        // escape field names with unique prefix
        foreach ($dataFields as $name => $field) {
            $field->Name = $this->escapeFieldName($id, $name);
            $dataFields[$name] = $field;
        }

        return $dataFields;
    }
private function filterRecordEditingFields(FieldList $fields, $id)
    {
        $config = $this->component->getConfig();
        $editableFields = $config['editableFields'];

        // get all dataFields or just the ones allowed in config
        if ($editableFields) {
            $dataFields = array();

            foreach ($editableFields as $fieldName) {
                $dataFields[$fieldName] = $fields->dataFieldByName($fieldName);
            }
        } else {
            $dataFields = $fields->dataFields();
        }

        // escape field names with unique prefix
        foreach ($dataFields as $name => $field) {
            $field->Name = $this->escapeFieldName($id, $name);
            $dataFields[$name] = $field;
        }

        return $dataFields;
    }
private function filterRecordEditingFields ( FieldList $ fields , $ id ) { $ config = $ this -> component -> getConfig ( ) ; $ editableFields = $ config [ 'editableFields' ] ; // get all dataFields or just the ones allowed in config if ( $ editableFields ) { $ dataFields = array ( ) ; foreach ( $ editableFields as $ fieldName ) { $ dataFields [ $ fieldName ] = $ fields -> dataFieldByName ( $ fieldName ) ; } } else { $ dataFields = $ fields -> dataFields ( ) ; } // escape field names with unique prefix foreach ( $ dataFields as $ name => $ field ) { $ field -> Name = $ this -> escapeFieldName ( $ id , $ name ) ; $ dataFields [ $ name ] = $ field ; } return $ dataFields ; }
Filters a records editable fields
based on component's config
and escape each field with unique name.

See {@link BulkManager} component for filtering config.

@param FieldList $fields Record's CMS Fields
@param int       $id     Record's ID, used fir unique name

@return array Filtered record's fields
Filters a records editable fields based on component s config and escape each field with unique name .