1
0

SoftDeleteTrait.php 344 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Traits;
  3. use App\Database;
  4. /**
  5. * @property string $dts_deleted
  6. * @method bool commit()
  7. */
  8. trait SoftDeleteTrait {
  9. public function softDelete(): bool {
  10. $this->dts_deleted = Database::dts();
  11. return $this->commit();
  12. }
  13. public function restore(): bool {
  14. $this->dts_deleted = null;
  15. return $this->commit();
  16. }
  17. }