1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?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;
- }
- }
|