You are here

function eck_uuid_property_entity_insert in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7.2 plugins/property_behavior/uuid.inc \eck_uuid_property_entity_insert()

Generate the UUID on entity insertion.

1 string reference to 'eck_uuid_property_entity_insert'
uuid.inc in plugins/property_behavior/uuid.inc

File

plugins/property_behavior/uuid.inc, line 30

Code

function eck_uuid_property_entity_insert($property, $vars) {
  if (module_exists('uuid')) {
    $entity = $vars['entity'];
    if (empty($entity->{$property})) {
      $entity->{$property} = uuid_generate();
    }
  }
}