123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace crmeb\traits;
- trait ErrorTrait
- {
-
- protected $error;
-
- protected function setError(?string $error = null)
- {
- $this->error = $error ?: '未知错误';
- return false;
- }
-
- public function getError()
- {
- $error = $this->error;
- $this->error = null;
- return $error;
- }
- }
|