Properties

$value

$value : 

Type

Methods

inArray()

inArray(  $value, boolean  $strict = false) : boolean

Checks if a value exists in an array

Parameters

$value
boolean $strict

Returns

boolean

keyExists()

keyExists(  $key) 

Parameters

$key

keysExist()

keysExist(  $keys = array()) 

Parameters

$keys

removeFirst()

removeFirst() : $this

remove first element of given array

Returns

$this

removeLast()

removeLast() : $this

remove last element of given array

Returns

$this

implode()

implode(string  $glue, string  $key = null) : string

The method joins the items in a collection.

Parameters

string $glue

The string you wish to place between the values.

string $key

If the value contains arrays or objects, you should pass the key of the attributes you wish to join

Returns

string

key()

key(string|integer|\app\framework\Component\StdLib\StdObject\StringObject\StringObject  $key, null|mixed  $value = null, boolean  $setOnlyIfDoesntExist = false) : $this|mixed|\app\framework\Component\StdLib\StdObject\StringObject\StringObject

Get or update the given key inside current array.

Parameters

string|integer|\app\framework\Component\StdLib\StdObject\StringObject\StringObject $key

Array key

null|mixed $value

If set, the value under current $key will be updated and not returned.

boolean $setOnlyIfDoesntExist

Set the $value only in case if the $key doesn't exist.

Returns

$this|mixed|\app\framework\Component\StdLib\StdObject\StringObject\StringObject

The value of the given key.

append()

append(mixed  $k, mixed  $v = null) : $this

Inserts an element to the end of the array.

If you set both params, that first param is the key, and second is the value, else first param is the value, and the second is ignored.

Parameters

mixed $k
mixed $v

Returns

$this

prepend()

prepend(mixed  $k, mixed  $v = null) : $this

Inserts an element at the beginning of the array.

If you set both params, that first param is the key, and second is the value, else first param is the value, and the second is ignored.

Parameters

mixed $k
mixed $v

Returns

$this

removeKey()

removeKey(  $key) 

remove key in current array

Parameters

$key

map()

map(callable  $call) : \app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObject

The method iterates through the array and passes each value to the given callback. The callback is free to modify the item and return it, thus forming a new ArrayObject of modified items

Parameters

callable $call

Returns

\app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObject

reverse()

reverse(boolean  $preserve = false) : $this

reverse elements order

Parameters

boolean $preserve

Returns

$this

shuffle()

shuffle() : $this

Shuffle elements in the array.

Returns

$this

unique()

unique(integer  $sortFlag = SORT_REGULAR) : $this

Removes duplicate values from an array

Parameters

integer $sortFlag

Sorting type flags:
SORT_REGULAR - compare items normally (don't change types)
SORT_NUMERIC - compare items numerically
SORT_STRING - compare items as strings
SORT_LOCALE_STRING - compare items as strings, based on the current locale.

Returns

$this

sortUsingFunction()

sortUsingFunction(callable  $comparisonFunction) : $this

Sort an array by values using a user-defined comparison function<br /> This function assigns new keys to the elements in array. It will remove any existing keys that may have been assigned, rather than just reordering the keys.<br /> The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Parameters

callable $comparisonFunction

Throws

\app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObjectException

Returns

$this

val()

val(null  $value = null) : mixed

Return, or update, current standard objects value.

Parameters

null $value

If $value is set, value is updated and ArrayObject is returned.

Returns

mixed

exception()

exception(  $message) 

Throw a standard object exception.

Parameters

$message

Throws

\app\framework\Component\StdLib\StdObject\StdObjectException

isSerialized()

isSerialized(string  $value, mixed  $result = null) : boolean

Checks if a string is serialized using quick string manipulation to throw out obviously incorrect strings. Unserialize is then run on the string to perform the final verification.

Valid serialized forms are the following:

  • boolean: b:1;
  • integer: i:1;
  • double: d:0.2;
  • string: s:4:"test";
  • array: a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}
  • object: O:8:"stdClass":0:{}
  • null: N;

Parameters

string $value

Value to test for serialized form

mixed $result

Result of unserialize() of the $value

Returns

boolean —

True if $value is serialized data, otherwise false

__construct()

__construct(  $value, boolean  $makeArrayObj = false) 

Parameters

$value
boolean $makeArrayObj

first()

first() 

last()

last() 

sum()

sum() : \app\framework\Component\StdLib\StdObject\ArrayObject\number

Get the sum of all elements inside the array.

Returns

\app\framework\Component\StdLib\StdObject\ArrayObject\number —

The sum of all elements from within the current array.

__toString()

__toString() : mixed

To string implementation.

Returns

mixed —

String 'Array'.

offsetExists()

offsetExists(mixed  $offset) : boolean

(PHP 5 &gt;= 5.0.0)<br/> Whether a offset exists

Parameters

mixed $offset

An offset to check for.

Returns

boolean —

true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

offsetGet()

offsetGet(mixed  $offset) : mixed

(PHP 5 &gt;= 5.0.0)<br/> Offset to retrieve

Parameters

mixed $offset

The offset to retrieve.

Returns

mixed —

Can return all value types.

offsetSet()

offsetSet(mixed  $offset, mixed  $value) : void

(PHP 5 &gt;= 5.0.0)<br/> Offset to set

Parameters

mixed $offset

The offset to assign the value to.

mixed $value

The value to set.

offsetUnset()

offsetUnset(mixed  $offset) : void

(PHP 5 &gt;= 5.0.0)<br/> Offset to unset

Parameters

mixed $offset

The offset to unset.

count()

count() : integer

(PHP 5 &gt;= 5.1.0)<br/> Count elements of an object

Returns

integer —

The custom count as an integer.

The return value is cast to an integer.

getIterator()

getIterator() : \app\framework\Component\StdLib\StdObject\ArrayObject\Traversable

(PHP 5 &gt;= 5.0.0)<br/> Retrieve an external iterator

Returns

\app\framework\Component\StdLib\StdObject\ArrayObject\Traversable —

An instance of an object implementing Iterator or Traversable

datetime()

datetime(string|integer  $time = "now", null|string  $timezone = null) : \app\framework\Component\StdLib\StdObject\DateTimeObject\DateTimeObject

Create an instance of DateTime Standard Object.

Parameters

string|integer $time

A date/time string. List of available formats is explained here http://www.php.net/manual/en/datetime.formats.php

null|string $timezone

Timezone in which you want to set the date. Here is a list of valid timezones: http://php.net/manual/en/timezones.php

Returns

\app\framework\Component\StdLib\StdObject\DateTimeObject\DateTimeObject

getObject()

getObject() : $this

Returns an Instance of current Object

Returns

$this

is()

is(  $var) 

Parameters

$var

isNull()

isNull(mixed  $var) : boolean

Checks if given value is null.

Parameters

mixed $var

Value to check

Returns

boolean

isEmpty()

isEmpty(mixed  $var) : boolean

Checks if given value is empty.

Parameters

mixed $var

Value to check

Returns

boolean

isObject()

isObject(mixed  $var) : boolean

Check if given value is an object.

Parameters

mixed $var

Value to check

Returns

boolean

isScalar()

isScalar(mixed  $var) : boolean

Check if given value is a scalar value.

Scalar values are: integer, float, boolean and string

Parameters

mixed $var

Value to check

Returns

boolean

isResource()

isResource(mixed  $var) : boolean

Check if given value is a resource.

Parameters

mixed $var

Value to check

Returns

boolean

isArray()

isArray(  $var) : boolean

Checks if given value is an array.

Parameters

$var

Returns

boolean

isNumber()

isNumber(  $var) : boolean

Checks if value is a number.

Parameters

$var

Returns

boolean

isInteger()

isInteger(  $var) : boolean

Checks if value is an integer.

Parameters

$var

Returns

boolean

isCallable()

isCallable(  $var) : boolean

Checks whenever resource is callable.

Parameters

$var

Returns

boolean

isString()

isString(  $var) : boolean

Checks if $var is type of string.

Parameters

$var

Returns

boolean

isBool()

isBool(  $var) : boolean

Checks if $var is type of boolean.

Parameters

$var

Returns

boolean

isBoolean()

isBoolean(  $var) : boolean

This is an alias function for self::isBool

Parameters

$var

Returns

boolean

isFile()

isFile(  $var) : boolean

Checks if $var is a file.

Parameters

$var

Returns

boolean

isReadable()

isReadable(  $var) : boolean

Checks if $var is readable.

Parameters

$var

Returns

boolean

isDirectory()

isDirectory(  $var) : boolean

Checks if $var is a directory.

Parameters

$var

Returns

boolean

isInstanceOf()

isInstanceOf(mixed  $instance, string  $type) : boolean

Check if $instance is of $type.

Parameters

mixed $instance
string $type

Returns

boolean

isSubClassOf()

isSubClassOf(string|object  $subclass, string  $class) : boolean

Check if $subclass is a subclass of $class.

Parameters

string|object $subclass
string $class

Returns

boolean

isStringObject()

isStringObject(mixed  $instance) : boolean

Check if $instance is a StringObject.

Parameters

mixed $instance

Returns

boolean

isDateTimeObject()

isDateTimeObject(mixed  $instance) : boolean

Check if $instance is a DateTimeObject.

Parameters

mixed $instance

Returns

boolean

isFileObject()

isFileObject(mixed  $instance) : boolean

Check if $instance is a FileObject.

Parameters

mixed $instance

Returns

boolean

isArrayObject()

isArrayObject(mixed  $instance) : boolean

Check if $instance is an ArrayObject.

Parameters

mixed $instance

Returns

boolean

isUrlObject()

isUrlObject(mixed  $instance) : boolean

Check if $instance is a UrlObject.

Parameters

mixed $instance

Returns

boolean