Documentation

DB extends Tools
in package

This class takes care of all DB operations For most operations, there are direct methods fully sanitized For less standard operations we have a _query method that allows for direct string query creation and bind parameters. Params are sanitized, the rest is not

USAGE

INSERT _insert( 'user', //table ['name' => 'Andy'] //WHAT array with column => value );

DELETE _delete( 'addressbook_contacts', //table array( 'addressbook'=>$id_addressbook, //WHERE array with column => value 'user'=>$user //optional values are considered AND ) )

SIMPLE SELECT _select( 'user_studio', //Table 'studio', //WHAT, can be a single field (string) or an array of fields array('user'=>$user), //WHERE array with column => value array('date_added' => 'DESC') //ORDER BY array with column => sort order )

SIMPLE SINGLE SELECT _sselect( 'user_studio', //Table 'studio', //WHAT, can be a single field (string) or an array of fields array('user'=>$user), //WHERE array with column => value array('date_added' => 'DESC') //ORDER BY array with column => sort order ) This method returns a single row with column names as keys, as opposed to a numbered array

FULL OPTIONS SELECT _select( 'tvseries_episode', //Table array('tvseries_episode.tvseries_episode_id','tvseries_episode.file','tvseries_season.season'), //WHAT, can be a single field (string) or an array of fields array('tvseries_episode.tvseries_id'=>$this->tvseries_id), //WHERE array with column => value array('tvseries_episode.episode_season_number' => 'ASC'), //ORDER BY array with column => sort order array(['rows' => 25, 'start' => 200]), //LIMIT array with rows for number of records and start for the first record array( 'products_media_report_tag' => [ ['products_media_report_page_tag.tag_id','products_media_report_tag.tag_id'] ]), //LEFT JOIN array with joined column as key and array of columnA = columnB ['dump' => true] //debugging options to print the full text query )

UPDATE _update( 'addressbook', //Table array('name'=>$name), //WHAT array with column => value array('id_addressbook' => $id_addressbook) //WHERE array with column => value )

FREE QUERY _query( $query = "SELECT addressbook.id_addressbook, addressbook.addressbook,addressbook.name, as_users.user_token FROM addressbook LEFT JOIN as_users ON (as_users.user_id = addressbook.user) WHERE addressbook.user = :user", //COMMAND query with bindable params $binds = array(':user' => $user); //BIND array with string => value )

Table of Contents

$pdo  : mixed
$prefixes  : mixed
__construct()  : mixed
_count()  : mixed
_delete()  : mixed
_insert()  : mixed
_insertupdate()  : mixed
_log()  : mixed
_query()  : mixed
_select()  : mixed
_sselect()  : mixed
_update()  : mixed
array_keys_recursive()  : mixed
array_orderby()  : mixed
arrayToObject()  : mixed
checkLoginCode()  : mixed
checkVAT()  : mixed
cleanLBs()  : mixed
createCookie()  : mixed
createNewsletterAddress()  : mixed
createRawCookie()  : mixed
curURL()  : mixed
db_echo()  : mixed
db_var_dump()  : mixed
destroyCookie()  : mixed
doSlug()  : mixed
doTextDate()  : mixed
dyn_url()  : mixed
editRecursiveArrayValuesByKey()  : array<string|int, mixed>
Traverse an array and edits it based on key and a user function
editRecursiveArrayValuesByKeyStrict()  : array<string|int, mixed>
Traverse an array and edits it based on key and a user function as soon as it finds the key name Different from editRecursiveArrayValuesByKey as this method doesn't look for non-array values It's just satisfied to find an array with key matching the provided string
encrypt_decrypt()  : mixed
fieldExists()  : mixed
fileIsText()  : mixed
fixObjectKeys()  : mixed
flatten()  : mixed
formatBytes()  : mixed
formatInsert()  : mixed
formatNameLastname()  : mixed
geoDistance()  : mixed
get_client_ip()  : mixed
getCookie()  : mixed
getImageData()  : mixed
getItemByField()  : mixed
getPercentageField()  : mixed
getSession()  : mixed
getZipCode()  : mixed
haversineGreatCircleDistance()  : float
Calculates the great-circle distance between two points, with the Haversine formula.
humanFileSize()  : mixed
isJSON()  : mixed
isNotnull()  : mixed
literalDate()  : mixed
makeTagID()  : mixed
mb_substr_replace()  : mixed
multiWhereQuery()  : array<string|int, mixed>
Returns a query for multiple items of the same column
notnull()  : mixed
nukeCookies()  : mixed
obfuscateEmail()  : mixed
objectToArray()  : mixed
photoFolderName()  : mixed
qrcodeFilename()  : mixed
qrcodeURL()  : mixed
queryUpdate()  : mixed
queryValidation()  : mixed
queryWhere()  : mixed
removeEmoji()  : mixed
requiredField()  : mixed
requiredFields()  : mixed
requiredKey()  : mixed
returnFile()  : mixed
returnObject()  : mixed
sanitize()  : mixed
sanitizeDBField()  : mixed
sanitizeDBFieldName()  : mixed
sanitizeFileName()  : mixed
sanitizeNames()  : mixed
sanitizeString()  : mixed
setSession()  : mixed
simpleModel()  : mixed
sortBySubValue()  : array<string|int, mixed>
stringSimilarity()  : mixed
strposAll()  : mixed
tableExists()  : mixed
valueExists()  : mixed
varSize()  : mixed
writeQuery()  : mixed
imageType()  : mixed

Properties

$prefixes

public static mixed $prefixes = ['39' => 'Italia (+39)', '44' => 'UK (+44)', '1' => 'USA (+1)', '1' => 'Canada (+1)', '213' => 'Algeria (+213)', '376' => 'Andorra (+376)', '244' => 'Angola (+244)', '1264' => 'Anguilla (+1264)', '1268' => 'Antigua (+1268)', '54' => 'Argentina (+54)', '374' => 'Armenia (+374)', '297' => 'Aruba (+297)', '61' => 'Australia (+61)', '43' => 'Austria (+43)', '994' => 'Azerbaijan (+994)', '1242' => 'Bahamas (+1242)', '973' => 'Bahrain (+973)', '880' => 'Bangladesh (+880)', '1246' => 'Barbados (+1246)', '375' => 'Belarus (+375)', '32' => 'Belgium (+32)', '501' => 'Belize (+501)', '229' => 'Benin (+229)', '1441' => 'Bermuda (+1441)', '975' => 'Bhutan (+975)', '591' => 'Bolivia (+591)', '387' => 'Bosnia (+387)', '267' => 'Botswana (+267)', '55' => 'Brazil (+55)', '673' => 'Brunei (+673)', '359' => 'Bulgaria (+359)', '226' => 'Burkina Faso (+226)', '257' => 'Burundi (+257)', '855' => 'Cambodia (+855)', '237' => 'Cameroon (+237)', '238' => 'Cape Verde (+238)', '1345' => 'Cayman (+1345)', '236' => 'C. African R. (+236)', '56' => 'Chile (+56)', '86' => 'China (+86)', '57' => 'Colombia (+57)', '269' => 'Comoros (+269)', '242' => 'Congo (+242)', '682' => 'Cook Islands (+682)', '506' => 'Costa Rica (+506)', '385' => 'Croatia (+385)', '53' => 'Cuba (+53)', '90392' => 'Cyprus N. (+90392)', '357' => 'Cyprus S. (+357)', '42' => 'Czech Rep. (+42)', '45' => 'Denmark (+45)', '253' => 'Djibouti (+253)', '1809' => 'Dominicana (+1809)', '593' => 'Ecuador (+593)', '20' => 'Egypt (+20)', '503' => 'El Salvador (+503)', '240' => 'Eq. Guinea (+240)', '291' => 'Eritrea (+291)', '372' => 'Estonia (+372)', '251' => 'Ethiopia (+251)', '500' => 'Falkland (+500)', '298' => 'Faroe (+298)', '679' => 'Fiji (+679)', '358' => 'Finland (+358)', '33' => 'France (+33)', '594' => 'F. Guiana (+594)', '689' => 'F. Polynesia (+689)', '241' => 'Gabon (+241)', '220' => 'Gambia (+220)', '7880' => 'Georgia (+7880)', '49' => 'Germany (+49)', '233' => 'Ghana (+233)', '350' => 'Gibraltar (+350)', '30' => 'Greece (+30)', '299' => 'Greenland (+299)', '1473' => 'Grenada (+1473)', '590' => 'Guadeloupe (+590)', '671' => 'Guam (+671)', '502' => 'Guatemala (+502)', '224' => 'Guinea (+224)', '245' => 'Guinea Bissau (+245)', '592' => 'Guyana (+592)', '509' => 'Haiti (+509)', '504' => 'Honduras (+504)', '852' => 'Hong Kong (+852)', '36' => 'Hungary (+36)', '354' => 'Iceland (+354)', '91' => 'India (+91)', '62' => 'Indonesia (+62)', '98' => 'Iran (+98)', '964' => 'Iraq (+964)', '353' => 'Ireland (+353)', '972' => 'Israel (+972)', '1876' => 'Jamaica (+1876)', '81' => 'Japan (+81)', '962' => 'Jordan (+962)', '7' => 'Kazakhstan (+7)', '254' => 'Kenya (+254)', '686' => 'Kiribati (+686)', '850' => 'Korea North (+850)', '82' => 'Korea South (+82)', '965' => 'Kuwait (+965)', '996' => 'Kyrgyzstan (+996)', '856' => 'Laos (+856)', '371' => 'Latvia (+371)', '961' => 'Lebanon (+961)', '266' => 'Lesotho (+266)', '231' => 'Liberia (+231)', '218' => 'Libya (+218)', '417' => 'Liechtenstein (+417)', '370' => 'Lithuania (+370)', '352' => 'Luxembourg (+352)', '853' => 'Macao (+853)', '389' => 'Macedonia (+389)', '261' => 'Madagascar (+261)', '265' => 'Malawi (+265)', '60' => 'Malaysia (+60)', '960' => 'Maldives (+960)', '223' => 'Mali (+223)', '356' => 'Malta (+356)', '692' => 'Marshall (+692)', '596' => 'Martinique (+596)', '222' => 'Mauritania (+222)', '269' => 'Mayotte (+269)', '52' => 'Mexico (+52)', '691' => 'Micronesia (+691)', '373' => 'Moldova (+373)', '377' => 'Monaco (+377)', '976' => 'Mongolia (+976)', '1664' => 'Montserrat (+1664)', '212' => 'Morocco (+212)', '258' => 'Mozambique (+258)', '95' => 'Myanmar (+95)', '264' => 'Namibia (+264)', '674' => 'Nauru (+674)', '977' => 'Nepal (+977)', '31' => 'Netherlands (+31)', '687' => 'New Caledonia (+687)', '64' => 'New Zealand (+64)', '505' => 'Nicaragua (+505)', '227' => 'Niger (+227)', '234' => 'Nigeria (+234)', '683' => 'Niue (+683)', '672' => 'Norfolk (+672)', '670' => 'N. Marianas (+670)', '47' => 'Norway (+47)', '968' => 'Oman (+968)', '680' => 'Palau (+680)', '507' => 'Panama (+507)', '675' => 'Papua Guinea (+675)', '595' => 'Paraguay (+595)', '51' => 'Peru (+51)', '63' => 'Philippines (+63)', '48' => 'Poland (+48)', '351' => 'Portugal (+351)', '1787' => 'Puerto Rico (+1787)', '974' => 'Qatar (+974)', '262' => 'Reunion (+262)', '40' => 'Romania (+40)', '7' => 'Russia (+7)', '250' => 'Rwanda (+250)', '378' => 'San Marino (+378)', '239' => 'Sao Tome (+239)', '966' => 'Saudi Arabia (+966)', '221' => 'Senegal (+221)', '381' => 'Serbia (+381)', '248' => 'Seychelles (+248)', '232' => 'Sierra Leone (+232)', '65' => 'Singapore (+65)', '421' => 'Slovacchia (+421)', '386' => 'Slovenia (+386)', '677' => 'Solomon (+677)', '252' => 'Somalia (+252)', '27' => 'South Africa (+27)', '34' => 'Spain (+34)', '94' => 'Sri Lanka (+94)', '290' => 'St. Helena (+290)', '1869' => 'St. Kitts (+1869)', '1758' => 'St. Lucia (+1758)', '249' => 'Sudan (+249)', '597' => 'Suriname (+597)', '268' => 'Swaziland (+268)', '46' => 'Sweden (+46)', '41' => 'Switzerland (+41)', '963' => 'Syria (+963)', '886' => 'Taiwan (+886)', '7' => 'Tajikstan (+7)', '66' => 'Thailand (+66)', '228' => 'Togo (+228)', '676' => 'Tonga (+676)', '1868' => 'Trinidad (+1868)', '216' => 'Tunisia (+216)', '90' => 'Turkey (+90)', '7' => 'Turkmenistan (+7)', '993' => 'Turkmenistan (+993)', '1649' => 'Turks Caicos (+1649)', '688' => 'Tuvalu (+688)', '256' => 'Uganda (+256)', '380' => 'Ukraine (+380)', '971' => 'UAE (+971)', '598' => 'Uruguay (+598)', '7' => 'Uzbekistan (+7)', '678' => 'Vanuatu (+678)', '379' => 'Vatican City (+379)', '58' => 'Venezuela (+58)', '84' => 'Vietnam (+84)', '84' => 'Virgin I. (+1284)', '84' => 'Virgin I. US (+1340)', '681' => 'Wallis (+681)', '969' => 'Yemen (North)(+969)', '967' => 'Yemen (South)(+967)', '260' => 'Zambia (+260)', '263' => 'Zimbabwe (+263)']

Methods

__construct()

public __construct() : mixed
Return values
mixed

_count()

public _count(mixed $table, mixed $values[, mixed $operator = "AND" ]) : mixed
Parameters
$table : mixed
$values : mixed
$operator : mixed = "AND"
Return values
mixed

_delete()

public _delete(mixed $table, mixed $where[, mixed $operator = "AND" ]) : mixed
Parameters
$table : mixed
$where : mixed
$operator : mixed = "AND"
Return values
mixed

_insert()

public _insert(mixed $table, mixed $values) : mixed
Parameters
$table : mixed
$values : mixed
Return values
mixed

_insertupdate()

public _insertupdate(mixed $table, mixed $values) : mixed
Parameters
$table : mixed
$values : mixed
Return values
mixed

_log()

public _log(mixed $type, mixed $file, mixed $method, mixed $error, mixed $data) : mixed
Parameters
$type : mixed
$file : mixed
$method : mixed
$error : mixed
$data : mixed
Return values
mixed

_query()

public _query(mixed $query[, mixed $bind_array = array() ]) : mixed
Parameters
$query : mixed
$bind_array : mixed = array()
Return values
mixed

_select()

public _select(mixed $table, mixed $what[, mixed $where = false ][, mixed $operator = "AND" ][, mixed $limits = false ][, mixed $join_data = false ][, mixed $options = [] ]) : mixed
Parameters
$table : mixed
$what : mixed
$where : mixed = false
$operator : mixed = "AND"
$limits : mixed = false
$join_data : mixed = false
$options : mixed = []
Return values
mixed

_sselect()

public _sselect(mixed $table, mixed $what, mixed $where[, mixed $operator = "AND" ]) : mixed
Parameters
$table : mixed
$what : mixed
$where : mixed
$operator : mixed = "AND"
Return values
mixed

_update()

public _update(mixed $table, mixed $what, mixed $where[, mixed $operator = "AND" ][, mixed $options = [] ]) : mixed
Parameters
$table : mixed
$what : mixed
$where : mixed
$operator : mixed = "AND"
$options : mixed = []
Return values
mixed

array_keys_recursive()

public static array_keys_recursive(array<string|int, mixed> $arr) : mixed
Parameters
$arr : array<string|int, mixed>
Return values
mixed

array_orderby()

public static array_orderby() : mixed
Return values
mixed

arrayToObject()

public static arrayToObject(mixed $array) : mixed
Parameters
$array : mixed
Return values
mixed

checkLoginCode()

public static checkLoginCode([mixed $language = false ]) : mixed
Parameters
$language : mixed = false
Return values
mixed

checkVAT()

public static checkVAT(mixed $vat_number, mixed $country) : mixed
Parameters
$vat_number : mixed
$country : mixed
Return values
mixed

cleanLBs()

public static cleanLBs(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

createCookie()

public static createCookie(mixed $key, mixed $value, mixed $expiration[, mixed $subdomains = false ]) : mixed
Parameters
$key : mixed
$value : mixed
$expiration : mixed
$subdomains : mixed = false
Return values
mixed

createNewsletterAddress()

public static createNewsletterAddress(mixed $id) : mixed
Parameters
$id : mixed
Return values
mixed

createRawCookie()

public static createRawCookie(mixed $key, mixed $value, mixed $expiration[, mixed $subdomains = false ]) : mixed
Parameters
$key : mixed
$value : mixed
$expiration : mixed
$subdomains : mixed = false
Return values
mixed

curURL()

public static curURL() : mixed
Return values
mixed

db_echo()

public db_echo(mixed $var) : mixed
Parameters
$var : mixed
Return values
mixed

db_var_dump()

public db_var_dump(mixed $var) : mixed
Parameters
$var : mixed
Return values
mixed

destroyCookie()

public static destroyCookie(mixed $key[, mixed $subdomains = false ]) : mixed
Parameters
$key : mixed
$subdomains : mixed = false
Return values
mixed

doSlug()

public static doSlug(mixed $str) : mixed
Parameters
$str : mixed
Return values
mixed

doTextDate()

public static doTextDate(mixed $date) : mixed
Parameters
$date : mixed
Return values
mixed

dyn_url()

public static dyn_url(mixed $song_id, mixed $slug) : mixed
Parameters
$song_id : mixed
$slug : mixed
Return values
mixed

editRecursiveArrayValuesByKey()

Traverse an array and edits it based on key and a user function

public static editRecursiveArrayValuesByKey(mixed $array, mixed $key, mixed $callback) : array<string|int, mixed>
Parameters
$array : mixed
$key : mixed
$callback : mixed
Tags
items

array : Your array to edit

key

string : Key that triggers the editing

callback

callable: Your editing function that takes care of both the logic and providing the edited value Your function must accept both key and value

Return values
array<string|int, mixed>

editRecursiveArrayValuesByKeyStrict()

Traverse an array and edits it based on key and a user function as soon as it finds the key name Different from editRecursiveArrayValuesByKey as this method doesn't look for non-array values It's just satisfied to find an array with key matching the provided string

public static editRecursiveArrayValuesByKeyStrict(mixed $array, mixed $key, mixed $callback) : array<string|int, mixed>
Parameters
$array : mixed
$key : mixed
$callback : mixed
Tags
items

array : Your array to edit

key

string : Key that triggers the editing

callback

callable: Your editing function that takes care of both the logic and providing the edited value Your function must accept both key and value

Return values
array<string|int, mixed>

encrypt_decrypt()

public static encrypt_decrypt(mixed $action, mixed $string, mixed $secret_iv) : mixed
Parameters
$action : mixed
$string : mixed
$secret_iv : mixed
Return values
mixed

fieldExists()

public fieldExists(mixed $table, mixed $field) : mixed
Parameters
$table : mixed
$field : mixed
Return values
mixed

fileIsText()

public static fileIsText(mixed $mime, mixed $extension) : mixed
Parameters
$mime : mixed
$extension : mixed
Return values
mixed

fixObjectKeys()

public static fixObjectKeys(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

flatten()

public static flatten(array<string|int, mixed> $array) : mixed
Parameters
$array : array<string|int, mixed>
Return values
mixed

formatBytes()

public static formatBytes(mixed $size[, mixed $precision = 2 ]) : mixed
Parameters
$size : mixed
$precision : mixed = 2
Return values
mixed

formatInsert()

public formatInsert(mixed $dataArray) : mixed
Parameters
$dataArray : mixed
Return values
mixed

formatNameLastname()

public formatNameLastname(mixed $name, mixed $lastname) : mixed
Parameters
$name : mixed
$lastname : mixed
Return values
mixed

geoDistance()

public static geoDistance(mixed $lat1, mixed $lon1, mixed $lat2, mixed $lon2[, mixed $unit = 'K' ]) : mixed
Parameters
$lat1 : mixed
$lon1 : mixed
$lat2 : mixed
$lon2 : mixed
$unit : mixed = 'K'
Return values
mixed

get_client_ip()

public static get_client_ip() : mixed
Return values
mixed

getCookie()

public static getCookie(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

getImageData()

public static getImageData(mixed $photo_blob) : mixed
Parameters
$photo_blob : mixed
Return values
mixed

getItemByField()

public static getItemByField(mixed $array, mixed $field, mixed $value) : mixed
Parameters
$array : mixed
$field : mixed
$value : mixed
Return values
mixed

getPercentageField()

public static getPercentageField(mixed $array, mixed $field, mixed $precision) : mixed
Parameters
$array : mixed
$field : mixed
$precision : mixed
Return values
mixed

getSession()

public static getSession(mixed $field) : mixed
Parameters
$field : mixed
Return values
mixed

getZipCode()

public static getZipCode(mixed $args) : mixed
Parameters
$args : mixed
Return values
mixed

haversineGreatCircleDistance()

Calculates the great-circle distance between two points, with the Haversine formula.

public static haversineGreatCircleDistance(float $latitudeFrom, float $longitudeFrom, float $latitudeTo, float $longitudeTo[, float $earthRadius = 6371000 ]) : float
Parameters
$latitudeFrom : float

Latitude of start point in [deg decimal]

$longitudeFrom : float

Longitude of start point in [deg decimal]

$latitudeTo : float

Latitude of target point in [deg decimal]

$longitudeTo : float

Longitude of target point in [deg decimal]

$earthRadius : float = 6371000

Mean earth radius in [m]

Return values
float

Distance between points in [m] (same as earthRadius)

humanFileSize()

public static humanFileSize(mixed $size[, mixed $unit = "" ]) : mixed
Parameters
$size : mixed
$unit : mixed = ""
Return values
mixed

isJSON()

public static isJSON(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

isNotnull()

public isNotnull(mixed $table, mixed $field) : mixed
Parameters
$table : mixed
$field : mixed
Return values
mixed

literalDate()

public static literalDate(mixed $date) : mixed
Parameters
$date : mixed
Return values
mixed

makeTagID()

public static makeTagID(mixed $tag) : mixed
Parameters
$tag : mixed
Return values
mixed

mb_substr_replace()

public static mb_substr_replace(mixed $string, mixed $replacement, mixed $start[, mixed $length = null ][, mixed $encoding = null ]) : mixed
Parameters
$string : mixed
$replacement : mixed
$start : mixed
$length : mixed = null
$encoding : mixed = null
Return values
mixed

multiWhereQuery()

Returns a query for multiple items of the same column

public multiWhereQuery(mixed $field, mixed $values[, mixed $condition = 'AND' ][, mixed $binds = [] ]) : array<string|int, mixed>
Parameters
$field : mixed
$values : mixed
$condition : mixed = 'AND'
$binds : mixed = []
Tags
field

string : user_id, service_id, etc.

values

array : Array of values to find

condition

string : defaults to AND

binds

array : binds array to add to if already built

Return values
array<string|int, mixed>

Returns query and binds array

notnull()

public notnull(mixed $table) : mixed
Parameters
$table : mixed
Return values
mixed

nukeCookies()

public static nukeCookies() : mixed
Return values
mixed

obfuscateEmail()

public static obfuscateEmail(mixed $email[, mixed $hard = false ]) : mixed
Parameters
$email : mixed
$hard : mixed = false
Return values
mixed

objectToArray()

public static objectToArray(mixed $object) : mixed
Parameters
$object : mixed
Return values
mixed

photoFolderName()

public static photoFolderName(mixed $user, mixed $restaurant) : mixed
Parameters
$user : mixed
$restaurant : mixed
Return values
mixed

qrcodeFilename()

public static qrcodeFilename(mixed $args) : mixed
Parameters
$args : mixed
Return values
mixed

qrcodeURL()

public static qrcodeURL(mixed $filename) : mixed
Parameters
$filename : mixed
Return values
mixed

queryUpdate()

public queryUpdate(mixed $values, mixed $operator[, mixed $bindArray = false ]) : mixed
Parameters
$values : mixed
$operator : mixed
$bindArray : mixed = false
Return values
mixed

queryValidation()

public queryValidation(mixed $table, mixed $values) : mixed
Parameters
$table : mixed
$values : mixed
Return values
mixed

queryWhere()

public queryWhere(mixed $values, mixed $condition) : mixed
Parameters
$values : mixed
$condition : mixed
Return values
mixed

removeEmoji()

public static removeEmoji(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

requiredField()

public requiredField(mixed $required, mixed $data) : mixed
Parameters
$required : mixed
$data : mixed
Return values
mixed

requiredFields()

public requiredFields(mixed $dataArray, mixed $table) : mixed
Parameters
$dataArray : mixed
$table : mixed
Return values
mixed

requiredKey()

public requiredKey(mixed $required, mixed $data) : mixed
Parameters
$required : mixed
$data : mixed
Return values
mixed

returnFile()

public static returnFile(mixed $response, mixed $payload, mixed $filename, mixed $mimetype) : mixed
Parameters
$response : mixed
$payload : mixed
$filename : mixed
$mimetype : mixed
Return values
mixed

returnObject()

public returnObject() : mixed
Return values
mixed

sanitize()

public sanitize(mixed $data, mixed $model) : mixed
Parameters
$data : mixed
$model : mixed
Return values
mixed

sanitizeDBField()

public sanitizeDBField(mixed $array, mixed $oldfield, mixed $newfield) : mixed
Parameters
$array : mixed
$oldfield : mixed
$newfield : mixed
Return values
mixed

sanitizeDBFieldName()

public sanitizeDBFieldName(mixed $field) : mixed
Parameters
$field : mixed
Return values
mixed

sanitizeFileName()

public static sanitizeFileName(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

sanitizeNames()

public static sanitizeNames(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

sanitizeString()

public static sanitizeString(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

setSession()

public static setSession(mixed $field, mixed $value) : mixed
Parameters
$field : mixed
$value : mixed
Return values
mixed

simpleModel()

public simpleModel(mixed $table, mixed $field, mixed $value) : mixed
Parameters
$table : mixed
$field : mixed
$value : mixed
Return values
mixed

sortBySubValue()

public static sortBySubValue(array<string|int, mixed> $array, string $value[, bool $asc = true ][, bool $preserveKeys = false ]) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$value : string
$asc : bool = true
  • ASC (true) or DESC (false) sorting
$preserveKeys : bool = false
Return values
array<string|int, mixed>

sortBySubValue($array, 'optionNumber', true, false);

stringSimilarity()

public static stringSimilarity(mixed $baseString, mixed $stringToMatch) : mixed
Parameters
$baseString : mixed
$stringToMatch : mixed
Return values
mixed

strposAll()

public static strposAll(mixed $needle, mixed $haystack) : mixed
Parameters
$needle : mixed
$haystack : mixed
Return values
mixed

tableExists()

public tableExists(mixed $table) : mixed
Parameters
$table : mixed
Return values
mixed

valueExists()

public valueExists(mixed $table, mixed $field, mixed $value) : mixed
Parameters
$table : mixed
$field : mixed
$value : mixed
Return values
mixed

varSize()

public static varSize(mixed $var) : mixed
Parameters
$var : mixed
Return values
mixed

writeQuery()

public writeQuery(mixed $query, mixed $binds) : mixed
Parameters
$query : mixed
$binds : mixed
Return values
mixed

imageType()

private static imageType(mixed $type) : mixed
Parameters
$type : mixed
Return values
mixed

Search results