123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- function tripal_ws_field_storage_info() {
- return array(
- 'field_tripal_ws_storage' => array(
- 'label' => t('Tripal Web Services'),
- 'description' => t('Retrieves fields data from a remote site using Tripal web services.'),
- 'settings' => array(),
- ),
- );
- }
- 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) {
- }
|