AccessHelper
in package
Table of Contents
Methods
- arrayValues() : array<string|int, mixed>
- collectionKeys() : array<string|int, mixed>
- getValue() : mixed
- isCollectionType() : bool
- keyExists() : bool
- setValue() : mixed
- unsetValue() : void
- getValueByIndex() : mixed|null
- Find item in php collection by index Written this way to handle instances ArrayAccess or Traversable objects
Methods
arrayValues()
public
static arrayValues(array<string|int, mixed>|ArrayAccess $collection) : array<string|int, mixed>
Parameters
- $collection : array<string|int, mixed>|ArrayAccess
Tags
Return values
array<string|int, mixed>collectionKeys()
public
static collectionKeys(array<string|int, mixed>|ArrayAccess $collection) : array<string|int, mixed>
Parameters
- $collection : array<string|int, mixed>|ArrayAccess
Return values
array<string|int, mixed>getValue()
public
static getValue(array<string|int, mixed>|ArrayAccess $collection, mixed $key[, bool $magicIsAllowed = false ]) : mixed
Parameters
- $collection : array<string|int, mixed>|ArrayAccess
- $key : mixed
- $magicIsAllowed : bool = false
Tags
isCollectionType()
public
static isCollectionType(array<string|int, mixed>|ArrayAccess $collection) : bool
Parameters
- $collection : array<string|int, mixed>|ArrayAccess
Return values
boolkeyExists()
public
static keyExists(array<string|int, mixed>|ArrayAccess $collection, mixed $key[, bool $magicIsAllowed = false ]) : bool
Parameters
- $collection : array<string|int, mixed>|ArrayAccess
- $key : mixed
- $magicIsAllowed : bool = false
Return values
boolsetValue()
public
static setValue(array<string|int, mixed>|ArrayAccess &$collection, mixed $key, mixed $value) : mixed
Parameters
- $collection : array<string|int, mixed>|ArrayAccess
- $key : mixed
- $value : mixed
unsetValue()
public
static unsetValue(array<string|int, mixed>|ArrayAccess &$collection, mixed $key) : void
Parameters
- $collection : array<string|int, mixed>|ArrayAccess
- $key : mixed
getValueByIndex()
Find item in php collection by index Written this way to handle instances ArrayAccess or Traversable objects
private
static getValueByIndex(array<string|int, mixed>|ArrayAccess $collection, mixed $key) : mixed|null
Parameters
- $collection : array<string|int, mixed>|ArrayAccess
- $key : mixed