Helpers
in package
User Extended by Shawn Clake Class Helpers User Extended is licensed under the MIT license.
Tags
Table of Contents
- arrayKeyToVal() : mixed|string
- Returns the value at a key in an array or a default value if that key is empty or doesn't exist
- deleteModel() : mixed
- Uses the desired delete type. Useful in cases where you need to dynamically determine whether a model should be hard deleted or soft deleted
- file() : mixed
- Returns a files contents specififed by $path
- hiBit() : int
- Returns an int with the highest bit in input as the only bit which is set Function example taken from Hacker's Delight
- isBitSet() : bool
- Returns true if $bit is set inside of $bits Both $bits and $bit are integers Returns false if the bit is not set
- unlimited() : int
- Returns the max int which SQL can handle. This is useful for returning 'unlimited' results
Methods
arrayKeyToVal()
Returns the value at a key in an array or a default value if that key is empty or doesn't exist
public
static arrayKeyToVal(array<string|int, mixed> $array, $key[, string $default = '' ]) : mixed|string
Parameters
Return values
mixed|string —deleteModel()
Uses the desired delete type. Useful in cases where you need to dynamically determine whether a model should be hard deleted or soft deleted
public
static deleteModel( $model[, bool $forceDelete = false ]) : mixed
Parameters
Return values
mixed —file()
Returns a files contents specififed by $path
public
static file( $path) : mixed
Parameters
Return values
mixed —hiBit()
Returns an int with the highest bit in input as the only bit which is set Function example taken from Hacker's Delight
public
static hiBit( $n) : int
Parameters
Return values
int —isBitSet()
Returns true if $bit is set inside of $bits Both $bits and $bit are integers Returns false if the bit is not set
public
static isBitSet( $bits, $bit) : bool
Parameters
Return values
bool —unlimited()
Returns the max int which SQL can handle. This is useful for returning 'unlimited' results
public
static unlimited(int $limit) : int
Parameters
- $limit : int