From ff77af0a8edabf2d62bcc3237143a0c5b7555b1f Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 17 Nov 2021 15:58:06 +0100 Subject: [PATCH] new: [appmodel] moved constants related to the logging along with a getter to app model --- src/Model/Entity/AppModel.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Model/Entity/AppModel.php b/src/Model/Entity/AppModel.php index 84c86b3..50bfe86 100644 --- a/src/Model/Entity/AppModel.php +++ b/src/Model/Entity/AppModel.php @@ -6,6 +6,28 @@ use Cake\ORM\Entity; class AppModel extends Entity { + const BROTLI_HEADER = "\xce\xb2\xcf\x81"; + const BROTLI_MIN_LENGTH = 200; + + const ACTION_ADD = 'add', + ACTION_EDIT = 'edit', + ACTION_SOFT_DELETE = 'soft_delete', + ACTION_DELETE = 'delete', + ACTION_UNDELETE = 'undelete', + ACTION_TAG = 'tag', + ACTION_TAG_LOCAL = 'tag_local', + ACTION_REMOVE_TAG = 'remove_tag', + ACTION_REMOVE_TAG_LOCAL = 'remove_local_tag', + ACTION_LOGIN = 'login', + ACTION_LOGIN_FAIL = 'login_fail', + ACTION_LOGOUT = 'logout'; + + + public function getConstant($name) + { + return constant('self::' . $name); + } + public function getAccessibleFieldForNew(): array { return $this->_accessibleOnNew ?? [];