Created
August 2, 2013 22:49
-
-
Save rapzo/6144094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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