12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- function tripal_ws_field_storage_info() {
- return [
- 'field_tripal_ws_storage' => [
- 'label' => t('Tripal Web Services'),
- 'description' => t('Retrieves fields data from a remote site using Tripal web services.'),
- 'settings' => [],
- ],
- ];
- }
- function tripal_ws_field_storage_load($entity_type, $entities, $age,
- $fields, $options) {
- $load_current = $age == FIELD_LOAD_CURRENT;
- global $language;
- $langcode = $language->language;
- foreach ($entities as $id => $entity) {
-
-
- foreach ($fields as $field_id => $ids) {
-
-
-
-
- $field = field_info_field_by_id($field_id);
- $field_name = $field['field_name'];
- $field_type = $field['type'];
- $field_module = $field['module'];
-
-
-
-
- $instance = field_info_instance($entity_type, $field_name, $entity->bundle);
- if (!$instance) {
- continue;
- }
-
- $entity->{$field_name}['und'][0]['value'] = '';
- tripal_load_include_field_class($field_type);
- if (class_exists($field_type) && method_exists($field_type, 'load')) {
- $tfield = new $field_type($field, $instance);
- $tfield->load($entity);
- }
- }
- }
- }
- function tripal_ws_field_storage_query($query) {
- }
- function tripal_ws_field_storage_write($entity_type, $entity, $op, $fields) {
- }
|