You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mods-for-HESK-Netsyms/api/BusinessLogic/Tickets/CustomFields/CustomFieldValidator.php

18 lines
515 B
PHP

<?php
namespace BusinessLogic\Tickets\CustomFields;
class CustomFieldValidator {
static function isCustomFieldInCategory($customFieldId, $categoryId, $staff, $heskSettings) {
$customField = $heskSettings['custom_fields']["custom{$customFieldId}"];
if (!$customField['use'] ||
(!$staff && $customField['use'] === 2)) {
return false;
}
return count($customField['category']) === 0 ||
in_array($categoryId, $customField['category']);
}
}