Skip to content

Instantly share code, notes, and snippets.

@rapzo
Created August 2, 2013 22:49
Show Gist options
  • Save rapzo/6144094 to your computer and use it in GitHub Desktop.
Save rapzo/6144094 to your computer and use it in GitHub Desktop.
class BaseModel extends \lithium\data\Model {
public function save($entity, $data = null, array $options = []) {
$now = new \MongoDate();
if (!$entity->exists()) {
$entity->created = $now;
}
$entity->updated = $now;
return parent::save($entity, $data, $options);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment