Pionia Core

Arrayable
in package
Uses Microable

Table of Contents

Properties

$macros  : array<string|int, mixed>
$array  : array<string|int, mixed>

Methods

__call()  : mixed
Dynamically handle calls to the class.
__callStatic()  : mixed
Dynamically handle calls to the class.
__construct()  : mixed
__get()  : mixed
__isset()  : mixed
__set()  : mixed
__toString()  : string
__unset()  : mixed
add()  : Arrayable
Add a key value pair to the array If only the key is provided, the key will be the value
addAfter()  : static
addBefore()  : static
all()  : array<string|int, mixed>
arrayType()  : string
Get the type of the array
at()  : mixed
chunk()  : static
each()  : static
filter()  : Arrayable
Filter the array
first()  : mixed
flush()  : static
flushMacros()  : void
Remove all the macros we had registered
get()  : mixed
Get an item from the array
has()  : bool
Check if the array has a key
hasMacro()  : bool
Check if we have a method in the balonables
isAssoc()  : bool
Checks if an array is associative
isEmpty()  : bool
Checks if the array is empty
isFilled()  : bool
isMixed()  : bool
Checks if an array has both numeric and string keys
keys()  : array<string|int, mixed>
Get the keys of the array
keysToLowerCase()  : static
keysToUpperCase()  : static
last()  : mixed
macro()  : void
Add a new mixable to the macros
map()  : Arrayable
Map through the array
merge()  : Arrayable
Merge a whole into the current array
mixin()  : void
Mix another object into the class.
pop()  : mixed
reduce()  : Arrayable
Reduce the array
remove()  : Arrayable
Remove an item from the array
replace()  : static
reverse()  : static
shift()  : mixed
size()  : int
Get the size of the array
slice()  : static
sort()  : static
sortKeys()  : static
sortValues()  : static
toArray()  : array<string|int, mixed>
Convert the arrayable to an array
toArrayable()  : Arrayable
toJson()  : string
Convert the arrayable to json
unshift()  : static
values()  : array<string|int, mixed>
Get the values of the array
valuesToLowerCase()  : static

Properties

$macros

protected static array<string|int, mixed> $macros = []

$array

private array<string|int, mixed> $array = []

Methods

__call()

Dynamically handle calls to the class.

public __call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
$method : string
$parameters : array<string|int, mixed>
Tags
throws
BadMethodCallException

__callStatic()

Dynamically handle calls to the class.

public static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
$method : string
$parameters : array<string|int, mixed>
Tags
throws
BadMethodCallException

__construct()

public __construct([array<string|int, mixed> $array = [] ]) : mixed
Parameters
$array : array<string|int, mixed> = []

__get()

public __get(mixed $name) : mixed
Parameters
$name : mixed

__isset()

public __isset(mixed $name) : mixed
Parameters
$name : mixed

__set()

public __set(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed

__toString()

public __toString() : string
Return values
string

__unset()

public __unset(mixed $name) : mixed
Parameters
$name : mixed

add()

Add a key value pair to the array If only the key is provided, the key will be the value

public add(string $key[, mixed|null $value = null ]) : Arrayable
Parameters
$key : string
$value : mixed|null = null
Return values
Arrayable

addAfter()

public addAfter(mixed $positionKey, mixed $key[, mixed $value = null ]) : static
Parameters
$positionKey : mixed
$key : mixed
$value : mixed = null
Return values
static

addBefore()

public addBefore(string $positionKey, string $key[, mixed $value = null ]) : static
Parameters
$positionKey : string
$key : string
$value : mixed = null
Return values
static

all()

public all() : array<string|int, mixed>
Return values
array<string|int, mixed>

arrayType()

Get the type of the array

public arrayType([array<string|int, mixed>|null $arr = null ]) : string
Parameters
$arr : array<string|int, mixed>|null = null
Return values
string

at()

public at(int $index) : mixed
Parameters
$index : int

chunk()

public chunk(int $size[, bool $preserve_keys = false ]) : static
Parameters
$size : int
$preserve_keys : bool = false
Return values
static

each()

public each(callable $callback) : static
Parameters
$callback : callable
Return values
static

flush()

public flush() : static
Return values
static

flushMacros()

Remove all the macros we had registered

public static flushMacros() : void

get()

Get an item from the array

public get(string|null $name[, bool|null $checkUpperAndLower = true ]) : mixed

If checkUpperAndLower is set to true, the method will check for uppercase and lowercase cases

Parameters
$name : string|null
$checkUpperAndLower : bool|null = true

has()

Check if the array has a key

public has(string $key) : bool
Parameters
$key : string
Return values
bool

hasMacro()

Check if we have a method in the balonables

public static hasMacro(string $name) : bool
Parameters
$name : string
Return values
bool

isAssoc()

Checks if an array is associative

public isAssoc([array<string|int, mixed>|null $arr = null ]) : bool
Parameters
$arr : array<string|int, mixed>|null = null
Return values
bool

isEmpty()

Checks if the array is empty

public isEmpty() : bool
Return values
bool

isFilled()

public isFilled() : bool
Return values
bool

isMixed()

Checks if an array has both numeric and string keys

public isMixed([array<string|int, mixed>|null $arr = null ]) : bool
Parameters
$arr : array<string|int, mixed>|null = null
Return values
bool

keys()

Get the keys of the array

public keys() : array<string|int, mixed>
Return values
array<string|int, mixed>

keysToLowerCase()

public keysToLowerCase() : static
Return values
static

keysToUpperCase()

public keysToUpperCase() : static
Return values
static

macro()

Add a new mixable to the macros

public static macro(string $key,  $value) : void
Parameters
$key : string
$value :

merge()

Merge a whole into the current array

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

mixin()

Mix another object into the class.

public static mixin(object $mixin[, bool $replace = true ]) : void
Parameters
$mixin : object
$replace : bool = true
Tags
throws
ReflectionException

reduce()

Reduce the array

public reduce(callable $callback[, null $initial = null ]) : Arrayable
Parameters
$callback : callable
$initial : null = null
Return values
Arrayable

replace()

public replace(string $key[, mixed $value = null ]) : static
Parameters
$key : string
$value : mixed = null
Return values
static

reverse()

public reverse() : static
Return values
static

size()

Get the size of the array

public size() : int
Return values
int

slice()

public slice(int $offset[, int $length = null ][, mixed $preserve_keys = false ]) : static
Parameters
$offset : int
$length : int = null
$preserve_keys : mixed = false
Return values
static

sort()

public sort(callable $callback) : static
Parameters
$callback : callable
Return values
static

sortKeys()

public sortKeys(callable $callback) : static
Parameters
$callback : callable
Return values
static

sortValues()

public sortValues(callable $callback) : static
Parameters
$callback : callable
Return values
static

toArray()

Convert the arrayable to an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toArrayable()

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

toJson()

Convert the arrayable to json

public toJson() : string
Return values
string

unshift()

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

values()

Get the values of the array

public values() : array<string|int, mixed>
Return values
array<string|int, mixed>

valuesToLowerCase()

public valuesToLowerCase() : static
Return values
static

        
On this page

Search results