You are here

function eck_changed_property_entity_save in Entity Construction Kit (ECK) 7.2

Same name and namespace in other branches
  1. 7.3 plugins/property_behavior/changed.inc \eck_changed_property_entity_save()

Store the current time in the property when the entity is changing.

1 string reference to 'eck_changed_property_entity_save'
changed.inc in plugins/property_behavior/changed.inc

File

plugins/property_behavior/changed.inc, line 18

Code

function eck_changed_property_entity_save($property, $vars) {
  $entity = $vars['entity'];
  if (empty($entity->is_new) || empty($entity->{$property})) {
    $entity->{$property} = time();
  }
}