Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
For reference on all non-PCR-360 Functions, please refer to the PHP Documentation.
Allowed Functions
Array
explode , implode , is_array , in_array , array_diff , array_diff_key, countarray_column, array_chunk, array_combine, array_count_values, array_diff, array_diff_assoc, array_diff_key, array_fill, array_fill_keys, array_flip, array_intersect, array_intersect_assoc, array_intersect_key, array_intersect, array_is_list, array_key_exists, array_keys, array_merge, array_merge_recursive, array_multisort, array_pad, array_pop, array_product, array_push, array_rand, array_reduce, array_replace, array_replace_recursive, array_reverse, array_search, array_shift, array_slice, array_splice, array_sum, array_unique, array_unshift, array_values, compact, count, current, end, extract, in_array, key_exists, krsort, ksort, list, next, pos, prev, range, reset, rsort, shuffle, sort
Class/Object
get_called_class, get_class, is_a, is_subclass_of
Class/Interface Access
DateInterval, DateTime, Exception, PCR_Event, PCR_Exception, throwable
JSON
json_decode , json_encode, json_last_error, json_last_error_msg, json_validate
cURL
curl_close, curl_init , curl_setopt , curl_exec , curl_errno , curl_error , curl_getinfo , curl_close , http_build_query
Date/Time
date , time , mktime , strtotime , DateTime , DateInterval , add , sub, diff, format , setTimestamp , setTime , setDate_copy_handle, curl_errno, curl_error, curl_escape, curl_exec, curl_getinfo, curl_init, curl_pause, curl_reset, curl_setopt, curl_setopt_array, curl_strerror, curl_unescape
Date/Time
add, diff, date_add, date_create, date_create_from_format, date_diff, date_format, date_get_last_errors, date_interval_create_from_string, date_interval_format, date_parse, date_parse_from_format, date_sub, date_time_set, date_timestamp_get, date_timestamp_set, date_timezone_get, date_timezone_set, date, format, mktime, microtime, setDate, setTime, setTimestamp, strtotime, sub, time
Exception Handling
getPrevious, getCode, getLine
Debug
error_log, debug
Debug Function
...
Note: The debug command outputs to a cache which is then displayed in the Debug tab/grid for the Custom Logic you are debugging.
Logical
as, if , elseif , else , switch , case , default , break , for , foreach , as , while , do-while , return , new
Mathematical
round , trunc ,ceil , floor , rand , srand , pow , exp , abs , max , min , bindec , hexdec , octdec , base_convertbreak, case, catch, continue, default, do, else, elseif, finally, for, foreach, function, match, new, return, switch, try, while
Mathematical
abs, base_convert, bindec, ceil, exp, floor, hexdec, max, min, octdec, pow, rand, round, srand, trunc
PCR-360 Data
call, listFindCode, query listFindValue, listGetByCode, listFindValue , listFindCodequery
Call Function
Code Block | ||
---|---|---|
| ||
/* $apiFunction Options: saveService, saveServiceDesk, saveContact, saveCable, saveGla, saveEquipment, saveLocation, renderCustomReport, renderCableViewPath */ array $this->call (string $apiFunctionToCall, array $params, bool $commitOnSuccess) |
...
Code Block | ||
---|---|---|
| ||
string $this->listGetByCode ( int $recid );string $this->listGetByCode ( int $recid ); |
PCR-360 Debug
debug, error_log
PCR-360 Events
attach, attachDb, callCustomEvent, detach, detachDb, trigger
PCR-360 Reports
addError, assign, barcode, loadReport
PCR-360 Utility
arrayToCsv, createFile, sendSystemMessage, callCustomEvent
arrayToCsv Function
Code Block |
---|
arrayToCsv(array $data, string $delimiter = ',', string $enclosure = '"'): array |
...
Code Block |
---|
// Example $bytesWritten = $this->createFile('MY-OUTBOUND-FILE.csv', $csv , 'OUTBOUND', true); if ($bytesWritten === false) { // There was an error creating the file, handle that here // Check the error log for more details } else { // The file was created successfully $bytesWritten will be the number of bytes written } |
Regular Expressions (Perl-Compatible)
String
is_numeric , strtolower , strtoupper , substr , stristr , strstr , stripos , strpos , strripos , strrpos , addslashes , chr , trim , ltrim , rtrim , str_replace , preg_match , preg_replace , preg_split , str_pad , sprintf , substr_replace , strlenpreg_filter, preg_grep, preg_last_error, preg_match, preg_match_all, preg_quote, preg_replace, preg_split
String
addslashes, bin2hex, chr, explode, html_entity_decode, htmlentities, htmlspecialchars, htmlspecialchars_decode, implode, ltrim, nl2br, number_format, rtrim, sprintf, str_contains, str_ends_with, str_getcsv, str_ireplace, str_pad, str_repeat, str_replace, str_shuffle, str_split, str_starts_with, strcasecmp, strip_tags, stripslashes, strtolower, strtoupper, substr_compare, substr_count, substr_replace, substr, stristr, strlen, stripos, strpos, strripos, strrpos, strstr, trim, wordwrap
URLs
base64_decode, base64_encode, get_headers, http_build_query, parse_url, rawurldecode, rawurlencode, urldecode, urlencode
Variable Handling
gettype, is_array, is_bool, is_float, is_int, is_iterable, is_numeric, is_object, is_string, isset
whitelist
get_defined_vars
Additional Functions
Contact PCR if you find a function that is not allowed, but would like to use.
PCR-360 Validation
...
setError, setMessage, setWarning
setError Function
Sets a validation error message. This messages output in the UI if the validation logic returns false. If this function is called multiple times, only the message from the last calls is displayed.
...