Created
March 14, 2013 14:04
-
-
Save alexpott/5161576 to your computer and use it in GitHub Desktop.
Field CMI moving from objects to arrays...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hook_field_attach_purge(\Drupal\Core\Entity\EntityInterface $entity, $field, $instance) { | |
// find the corresponding data in mymodule and purge it | |
- if ($entity->entityType() == 'node' && $field->field_name == 'my_field_name') { | |
+ if ($entity->entityType() == 'node' && $field['field_name'] == 'my_field_name') { | |
mymodule_remove_mydata($entity->nid); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment