\app\framework\Component\StdLib\StdObjectStdObjectWrapper

Standard object wrapper.

This class is used when we need to return a standard object, but none of the current available standard objects fit the role.

Summary

Methods
Properties
Constants
val()
exception()
isSerialized()
isStringObject()
isDateTimeObject()
isFileObject()
isArrayObject()
isUrlObject()
__construct()
returnStdObject()
toString()
toArray()
toBool()
__toString()
No public properties found
No constants found
getObject()
is()
isNull()
isEmpty()
isObject()
isScalar()
isResource()
isArray()
isNumber()
isInteger()
isCallable()
isString()
isBool()
isBoolean()
isFile()
isReadable()
isDirectory()
isInstanceOf()
isSubClassOf()
$value
N/A
No private methods found
No private properties found
N/A

Properties

$value

$value : 

Type

Methods

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

isStringObject()

isStringObject(mixed  $var) : boolean

Check if $var is an instance of StringObject.

Parameters

mixed $var

Element to check.

Returns

boolean

isDateTimeObject()

isDateTimeObject(mixed  $var) : boolean

Check if $var is an instance of DateTimeObject.

Parameters

mixed $var

Element to check.

Returns

boolean

isFileObject()

isFileObject(mixed  $var) : boolean

Check if $var is an instance of FileObject.

Parameters

mixed $var

Element to check.

Returns

boolean

isArrayObject()

isArrayObject(mixed  $var) : boolean

Check if $var is an instance of ArrayObject.

Parameters

mixed $var

Element to check.

Returns

boolean

isUrlObject()

isUrlObject(mixed  $var) : boolean

Check if $var is an instance of UrlObject.

Parameters

mixed $var

Element to check.

Returns

boolean

__construct()

__construct(mixed  $value) 

Constructor.

Set standard object value.

Parameters

mixed $value

returnStdObject()

returnStdObject(mixed  $var) : \app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObject|\app\framework\Component\StdLib\StdObject\StdObjectWrapper|\app\framework\Component\StdLib\StdObject\StringObject\StringObject

This function make sure you are returning a standard object.

Parameters

mixed $var

Returns

\app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObject|\app\framework\Component\StdLib\StdObject\StdObjectWrapper|\app\framework\Component\StdLib\StdObject\StringObject\StringObject

toString()

toString(mixed  $var) : string

Returns a string based on given $var.

This function checks if $var is a string, StringObject or something else. In the end a string is returned.

Parameters

mixed $var

Returns

string

toArray()

toArray(mixed  $var) : array

Returns an array based on given $var.

This function checks if $var is an array, ArrayObject or something else. This function tries to cast the element to array and return it.

Parameters

mixed $var

Returns

array

toBool()

toBool(mixed  $var) : boolean

Returns a bool value based on whatever value passed in.<br> These values are considered TRUE: '1', 'true', 'on', 'yes', 'y'

Parameters

mixed $var

Returns

boolean

__toString()

__toString() : mixed

To string implementation.

Returns

mixed

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