This document provides a programmer's reference to the xml get and xml put engines of the Drupal Import / Export API. For an explanation of the field types and their core properties, see the main Import / Export API reference document.
Skip to: Properties
Legend:
X = property can be used with this field type
- = this property is not applicable to this field type
#type | array | datetime | entity | file | float | freeform | int | serialized | string |
---|---|---|---|---|---|---|---|---|---|
#xml_hidden | - | X | - | X | X | X | X | X | X |
#xml_mapping | X | X | X | X | X | X | X | X | X |
#xml_plural | X | - | X | - | - | X | - | - | - |
Used by: ALL types except entity, array.
Description: When set to TRUE, indicates that this field should not be outputted during an xml 'put' operation.
Values: Boolean.
Default value: NULL
Usage example: NONE
Used by: ALL
Description: The XML tag name for this field. During a 'put' operation, the value of this field will be wrapped in a tag with this name; and during a 'get' operation, the system will search for tags with this name. For field types that contain multiple values, this name applies to the tags that enclose each individual value; this should NOT be confused with the #xml_plural property, which applies to tags that enclose multiple values.
Values: A valid XML tag name. Note: this value must be different to the value of the XML tags that will become this field's respective direct parent and direct child (as well as siblings). For example, if this field is an array, then both the #xml_plural value of this field, and the #xml_mapping value (or, where applicable, the #xml_plural value) of this field's direct children, must be different to the value of this property for this field.
Default value: inherited from the #id property of this field.
Usage example: (importexportapi_node.inc):
<?php
$def['revisions'] = array(
'#type' => 'array',
'#title' => t('Revisions'),
'#db_default_table' => 'node_revisions',
'#xml_plural' => 'revisions',
'#xml_mapping' => 'revision',
'#csv_plural' => 'node-revisions'
);
?>
Used by: entity, array, freeform.
Description: The XML tag name for a collection of values for this field. During a 'put' operation, the collection of values for this field will be wrapped in a tag with this name; and during a 'get' operation, the system will search for tags with this name. This property should NOT be confused with the #xml_mapping property, which applies to the tags that enclose each individual value, and which also applies to all field types.
Values: A valid XML tag name. Note: this value must always be different to the value of #xml_mapping, in any field for which both of these properties apply. If this field has a parent field, then the #xml_mapping value for the parent field should also be different to this property for this field. Additionally, this property should be unique for all sibling fields.
Default value: inherited from the #id property of this field.
Usage example: (importexportapi_node.inc):
<?php
$def = array(
'#type' => 'entity',
'#title' => t('Node'),
'#db_default_table' => 'node',
'#xml_plural' => 'nodes',
'#csv_plural' => 'nodes'
);
?>