You are here

function _views_bulk_operations_hash_object in Views Bulk Operations (VBO) 6

Helper function to calculate hash of an object.

The default "hashing" is to use the object's primary/unique id. This would fail for VBOs that return many rows with the same primary key (e.g. a *node* view returning all node *comments*). Because we don't know in advance what kind of hashing is needed, we allow for a module to implement its own hashing via

hook_views_bulk_operations_object_hash_alter(&$hash, $object, $view).

File

./views_bulk_operations.module, line 2084
Allows operations to be performed on items selected in a view.

Code

function _views_bulk_operations_hash_object($object, $view) {
  $hash = $object->{$view->base_field};
  drupal_alter('views_bulk_operations_object_hash', $hash, $object, $view);
  return $hash;
}