Skip to content

Commit

Permalink
Update AdvancedModel.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lesichkovm committed Jul 19, 2018
1 parent a03b40b commit 9c43e79
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/AdvancedModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,17 @@ private function generateUniqueId() {
function generateUuid() {
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
}

public function trash(){
$deletedAtKey = self::DELETED_AT;
$this->$deletedAtKey = date('Y-m-d H:i:s');
return $this->save();
}

public function untrash(){
$deletedAtKey = self::DELETED_AT;
$this->$deletedAtKey = NULL;
return $this->save();
}

}

0 comments on commit 9c43e79

Please sign in to comment.