CerPresetFeaturesController.inc 824 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Contains the controller class for exporting CER presets via Features.
  4. */
  5. class CerPresetFeaturesController extends EntityDefaultFeaturesController {
  6. /**
  7. * Overridden.
  8. */
  9. public function export($data, &$export, $module = '') {
  10. $pipe = parent::export($data, $export, $module);
  11. // Every field in both chains may need to export additional things (the
  12. // field base and instance definitions at least, plus any extra dependencies).
  13. // All that logic is delegated to CerFieldChain.
  14. foreach (entity_load_multiple_by_name($this->type, $data) as $preset) {
  15. $pipe = array_merge_recursive($pipe, $preset->wrapper->cer_left->chain->value()->export());
  16. $pipe = array_merge_recursive($pipe, $preset->wrapper->cer_right->chain->value()->export());
  17. }
  18. return $pipe;
  19. }
  20. }