-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdimfield.install
More file actions
41 lines (35 loc) · 820 Bytes
/
dimfield.install
File metadata and controls
41 lines (35 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Implements hook_field_schema().
*
* Pseudo-hook.
*/
function dimfield_field_schema($field) {
if ($field['type'] == 'dimensions') {
$schema['columns']['height'] = array(
'type' => 'int',
'not null' => FALSE,
);
$schema['columns']['width'] = array(
'type' => 'int',
'not null' => FALSE,
);
$schema['indexes'] = array(
'height' => array('height'),
'width' => array('width'),
);
if ($field['settings']['num_dimensions'] == 3) {
$schema['columns']['depth'] = array(
'type' => 'int',
'not null' => FALSE,
);
$schema['indexes']['depth'] = array('depth');
}
$schema['columns']['units'] = array(
'type' => 'varchar',
'length' => 10,
'not null' => FALSE,
);
return $schema;
}
}