class EntityReferenceInstanceBehaviorExample in Entity reference 7
Hierarchy
- class \EntityReference_BehaviorHandler_Abstract implements EntityReference_BehaviorHandler
Expanded class hierarchy of EntityReferenceInstanceBehaviorExample
1 string reference to 'EntityReferenceInstanceBehaviorExample'
- test_instance_behavior.inc in examples/
entityreference_behavior_example/ plugins/ behavior/ test_instance_behavior.inc
File
- examples/
entityreference_behavior_example/ plugins/ behavior/ EntityReferenceInstanceBehaviorExample.class.php, line 3
View source
class EntityReferenceInstanceBehaviorExample extends EntityReference_BehaviorHandler_Abstract {
public function load($entity_type, $entities, $field, $instances, $langcode, &$items) {
drupal_set_message(t('Do something on load, on the instance level!'));
}
public function insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
drupal_set_message(t('Do something on insert, on the instance level!'));
}
public function update($entity_type, $entity, $field, $instance, $langcode, &$items) {
drupal_set_message(t('Do something on update, on the instance level!'));
}
public function delete($entity_type, $entity, $field, $instance, $langcode, &$items) {
drupal_set_message(t('Do something on delete, on the instance level!'));
}
/**
* Generate a settings form for this handler.
*/
public function settingsForm($field, $instance) {
$form['test_instance'] = array(
'#type' => 'checkbox',
'#title' => t('Instance behavior setting'),
);
return $form;
}
}