function content_storage_type in Content Construction Kit (CCK) 6.2
Same name and namespace in other branches
- 6.3 content.module \content_storage_type()
- 6 content.module \content_storage_type()
Helper function for identifying the storage type for a field.
3 calls to content_storage_type()
- content_field_edit_form_validate in includes/
content.admin.inc - Validate a field's settings.
- content_field_instance_create in includes/
content.crud.inc - Create a new field instance.
- content_field_instance_update in includes/
content.crud.inc - Update an existing field instance.
File
- ./
content.module, line 1602 - Allows administrators to associate custom fields to content types.
Code
function content_storage_type($field) {
if ($field['multiple'] > 0) {
return CONTENT_DB_STORAGE_PER_FIELD;
}
else {
module_load_include('inc', 'content', 'includes/content.crud');
$instances = content_field_instance_read(array(
'field_name' => $field['field_name'],
));
if (count($instances) > 1) {
return CONTENT_DB_STORAGE_PER_FIELD;
}
}
return CONTENT_DB_STORAGE_PER_CONTENT_TYPE;
}