function eck_created_property_entity_insert in Entity Construction Kit (ECK) 7.2
Same name and namespace in other branches
- 7.3 plugins/property_behavior/created.inc \eck_created_property_entity_insert()
Save the current time when the entity is saved.
1 string reference to 'eck_created_property_entity_insert'
- created.inc in plugins/
property_behavior/ created.inc
File
- plugins/
property_behavior/ created.inc, line 18
Code
function eck_created_property_entity_insert($property, $vars) {
$entity = $vars['entity'];
if (isset($entity->is_new) && $entity->is_new && empty($entity->{$property})) {
$entity->{$property} = time();
}
}