TestUserEventModel.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Tioncico
  5. * Date: 2019/10/22 0022
  6. * Time: 15:08
  7. */
  8. namespace EasySwoole\ORM\Tests\models;
  9. use EasySwoole\ORM\AbstractModel;
  10. use EasySwoole\Utility\Str;
  11. /**
  12. * Class TestUserModel
  13. * @package EasySwoole\ORM\Tests
  14. * @property $id
  15. * @property $name
  16. * @property $age
  17. * @property $addTime
  18. * @property $state
  19. */
  20. class TestUserEventModel extends AbstractModel
  21. {
  22. protected $tableName = 'test_user_model';
  23. public static $insert = false;
  24. public static $update = false;
  25. public static $delete = false;
  26. protected static function onBeforeInsert($model)
  27. {
  28. return self::$insert;
  29. }
  30. protected static function onAfterInsert($model, $res)
  31. {
  32. }
  33. protected static function onBeforeUpdate($model)
  34. {
  35. return self::$update;
  36. }
  37. protected static function onAfterUpdate($model, $res)
  38. {
  39. }
  40. protected static function onBeforeDelete()
  41. {
  42. return self::$delete;
  43. }
  44. public static function onAfterDelete($model, $res)
  45. {
  46. }
  47. }