hook_def_field_types($op)
importexportapi/docs/developer/hooks/importexportapi.php, line 98
Define certain characteristics of one or more field types.
$op What kind of characteristics are being sought. Possible values:
This varies depending on the operation.
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
<?php
function hook_def_field_types($op) {
$type = array();
switch ($op) {
case 'placeholders':
$type['int'] = '%d';
$type['float'] = '%f';
$type['string'] = "'%s'";
$type['file'] = "'%s'";
$type['freeform'] = "'%s'";
$type['serialized'] = "'%s'";
$type['datetime'] = "'%s'";
break;
case 'defaults':
$type['int'] = array('#required' => FALSE, '#default_value' => 0);
$type['float'] = array('#required' => FALSE, '#default_value' => 0.0);
$type['string'] = array('#required' => FALSE, '#default_value' => '');
$type['file'] = array('#required' => FALSE, '#default_value' => '');
$type['freeform'] = array('#required' => FALSE, '#default_value' => array(), '#process' => array('importexportapi_process_freeform' => array()));
$type['serialized'] = array('#required' => FALSE, '#default_value' => '', '#process' => array('importexportapi_process_serialized' => array()));
$type['datetime'] = array('#required' => FALSE, '#default_value' => '', '#process' => array('importexportapi_process_datetime' => array()));
$type['array'] = array('#process' => array('importexportapi_process_array' => array()));
$type['entity'] = array();
break;
}
return $type;
}
?>