1
0
Files
TaskBoard/backend/app/class/enity/class_base.php
Falknat a9c146b192 Развитие бека
1. Создание БД
2. Создание бека
3. Пока создали класс юзера
2026-01-11 17:48:05 +07:00

30 lines
634 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
abstract class BaseEntity
{
protected static $status_error = 0;
protected static $error_message = [];
// Вспомогательные методы для работы с ошибками
protected function addError($key, $message)
{
static::$status_error = 1;
static::$error_message[$key] = $message;
}
// Получить ошибки
public function getErrors()
{
if (static::$error_message) {
return [
'success' => false,
'errors' => static::$error_message
];
}
return null;
}
}
?>