CoolCMS API

ResultCode : int
in package

Table of Contents

Cases

ACCESS_TOKEN_EXPIRED  = 402
ACCESS_TOKEN_INVALID  = 403
ACTION_FAILED  = 701
ACTION_SUCCESS  = 700
ADVERT_CATEGORY_REQUIRED  = 618
ADVERT_CONFIRMATION_KEY_INVALID  = 627
ADVERT_CURRENCY_NOT_ALLOWED  = 625
ADVERT_DELETE_BLOCKED  = 624
API_ERROR  = 500
API_NOT_FOUND  = 504
API_RESPONSE_INVALID  = 503
API_TIMEOUT  = 502
API_UNAUTHORIZED  = 501
BILLING_LINE_DELETE_BLOCKED  = 632
CALENDAR_DELETE_BLOCKED  = 634
COMPANY_DELETE_BLOCKED  = 633
COMPLAINT_DELETE_BLOCKED  = 631
DB_CONSTRAINT_VIOLATION  = 301
DB_DUPLICATE_ENTRY  = 303
DB_ERROR  = 300
DB_LOCKED  = 304
DB_NOT_FOUND  = 302
FILE_NOT_FOUND  = 203
FILE_PERMISSION_DENIED  = 206
FILE_TYPE_NOT_ALLOWED  = 207
FILE_UPLOAD_FAILED  = 205
FILE_WRITE_FAILED  = 204
IMAGE_FORMAT_INVALID  = 201
IMAGE_TOO_LARGE  = 202
IMAGE_UPLOADED  = 200
INVALID_ARGUMENT  = 606
INVALID_CONFIGURATION  = 605
INVALID_CSRF_TOKEN  = 401
INVALID_DATA  = 604
INVALID_FORMAT  = 610
INVALID_INDEX  = 613
INVALID_KEY  = 614
INVALID_LENGTH  = 611
INVALID_OPERATION  = 607
INVALID_PASSWORD  = 108
INVALID_RANGE  = 612
INVALID_REQUEST  = 608
INVALID_RESPONSE  = 609
INVALID_STATE  = 600
INVALID_TYPE  = 601
INVALID_VALUE  = 615
INVOICE_LOCKED  = 638
INVOICE_NUMBERED_DELETE_BLOCKED  = 626
ITEM_NOT_FOUND  = 616
MESSAGE_CONFIRMATION_KEY_INVALID  = 628
MISSING_REQUIRED_FIELD  = 602
NOT_AVAILABLE  = 4
NOT_IMPLEMENTED  = 3
OK  = 0
OPERATION_CANCELLED  = 5
PDF_LAYOUT_DEFAULT_REQUIRED  = 640
PERMISSION_DENIED  = 400
PRESENTER_ALREADY_EXISTS  = 802
PRESENTER_NOT_AVAILABLE  = 800
PRESENTER_NOT_AVAILABLE_FOR_THIS_REQUEST  = 804
PRESENTER_NOT_FOUND  = 801
PRESENTER_NOT_IMPLEMENTED  = 803
PRODUCT_DELETE_BLOCKED  = 629
PRODUCT_DELETE_HIDDEN  = 639
PRODUCT_SET_DELETE_BLOCKED  = 630
QUEUE_ERROR  = 702
RATE_LIMIT_EXCEEDED  = 404
SUPPLIER_DELETE_BLOCKED  = 636
TASK_TIMEOUT  = 703
TREE_LOCKED  = 620
TREE_NO_SIBLING  = 637
TREE_NODE_CORRUPTED  = 617
TREE_STALE  = 619
UNKNOWN_ERROR  = 1
UNSUPPORTED_OPERATION  = 603
USER_ACTIVATION_KEY_INVALID  = 111
USER_ACTIVATION_REQUIRED  = 114
USER_ALREADY_ACTIVE  = 107
USER_ALREADY_EXISTS  = 101
USER_BLOCKED  = 104
USER_CREATED  = 100
USER_DEACTIVATE_LAST_HOLDER_BLOCKED  = 125
USER_DELETE_LAST_HOLDER_BLOCKED  = 123
USER_DELETE_SELF_BLOCKED  = 122
USER_DELETED  = 120
USER_DELETION_CONFIRMATION_SENT  = 119
USER_DELETION_KEY_INVALID  = 118
USER_DELETION_PENDING  = 117
USER_EXTERNAL_EMAIL_NOT_VERIFIED  = 113
USER_EXTERNAL_LINK_CONFIRMATION_SENT  = 115
USER_EXTERNAL_LINK_KEY_INVALID  = 116
USER_INACTIVE  = 109
USER_LOGIN_INVALID_CREDENTIALS  = 110
USER_NOT_FOUND  = 102
USER_NOT_LOGGED_IN  = 103
USER_PASSWORD_RESET_KEY_INVALID  = 112
USER_ROLE_ASSIGNMENT_DENIED  = 121
USER_ROLE_LAST_HOLDER_BLOCKED  = 124
USER_SESSION_EXPIRED  = 106
USER_UNAUTHORIZED  = 105
VALIDATION_FAILED  = 2
WAREHOUSE_DELETE_BLOCKED  = 635
WORK_LIST_ARCHIVED  = 623
WORK_LIST_HAS_INVOICED_SHEETS  = 621
WORK_LIST_NOT_EMPTY  = 622

Methods

fromValue()  : self|null
httpStatus()  : int
isTechnical()  : bool
Tells whether the code is a technical failure (DB, transport, queue, file write, unexpected error): the message of such a `Result` is usually the text of a captured exception (SQL, ORM, host, path), not a controlled message for the user. It is therefore not passed across the UI/JSON boundary, see {@see Result::getPublicMessage()}.
level()  : string
resolve()  : self
translationKey()  : string
Returns the key into the `results` translation domain (files `app/Locale/results/<locale>/results.*.neon`).

Cases

Methods

fromValue()

public static fromValue(int $value) : self|null
Parameters
$value : int
Return values
self|null

httpStatus()

public httpStatus() : int
Return values
int

isTechnical()

Tells whether the code is a technical failure (DB, transport, queue, file write, unexpected error): the message of such a `Result` is usually the text of a captured exception (SQL, ORM, host, path), not a controlled message for the user. It is therefore not passed across the UI/JSON boundary, see {@see Result::getPublicMessage()}.

public isTechnical() : bool

Domain codes (validation, state, not found, permissions) are not technical: their messages are written deliberately and the editor needs them (including DB_LOCKED, "try again"). DB_DUPLICATE_ENTRY is technical because the shared SaveTrait wraps the text of UniqueConstraintViolationException into it.

Return values
bool

level()

public level() : string
Return values
string

resolve()

public static resolve(int|self|null $code) : self
Parameters
$code : int|self|null
Return values
self

translationKey()

Returns the key into the `results` translation domain (files `app/Locale/results/<locale>/results.*.neon`).

public translationKey() : string

IMPORTANT: the enum case name is SCREAMING_SNAKE (USER_INACTIVE) while the neon keys are camelCase (userInactive), so a full conversion is needed. A plain lcfirst() lowercases only the first letter and yields results.uSER_INACTIVE, a key that exists nowhere; the user would then see the raw key instead of the message (returnOriginalMessage returns a missing key unchanged).

Return values
string
On this page

Search results