Get

Wrapper for $_GET. It is recommended to never create an object from this class, use a "Request" instance to access an instance of this class. e.g. "$request->Get->has("key");".
The "Request" instance will only create a "IRequestArray" instance if it is demanded and the instance will be used for further calls.
As instanced of this class are created and accessed via an "IRequest", this class is not included into the autoload.
Source
Get.php
Implements
IRequestArray
Depends on
Request , key
Since
1.0.0

Static Methods

clear

void Get::clear()

Empty $_GET.

Returns

void

has

bool Get::has(string key)

Check if a key exists in $_GET.

Arguments

    key (string)
    Key to be checked

Returns

bool
true=key exists

hasValue

bool Get::hasValue(string key, mixed val)

Check if a key has a given value A[key] === val.

Arguments

    key (string)
    Key to compare it's value
    val (mixed)
    Value to be compared to

Returns

bool
true=key has the given value

like

array Get::like(string key)

Get {key:value,} from "$_GET" where the keys in source contain the "key" string inside them.

Since
Artaengine 1.2.2

Arguments

    key (string)
    String to be searched in "source" keys

Returns

array
{key:value,} a subset of "source" where keys contains "key"

remove

void Get::remove([string] key)

Remove key(s).

Arguments

    key ([string])
    The key or keys to be removed

Returns

void

set

void Get::set(string key, mixed val)

Set a value to the $_GET array.

Arguments

    key (string)
    Key to set the value to
    val (mixed)
    Value to be set

Returns

void

with

array Get::with(string key, bool remove)

Get {key:value,} from "$_GET" where the keys in source start with the "key".

Since
Artaengine 1.2.0

Arguments

    key (string)
    String to be searched in "source" keys
    remove (bool)
    true=remove "key" from the keys in the returned array

Returns

array
{key:value,} a subset of "source" where keys start with "key"

Methods

__call

mixed $obj->aNotExistingMethod(string key, mixed default=null, const type=null)

Get a value from $_GET.

Arguments

    key (string)
    The key to get it's value
    default=null (mixed)
    The default-value to be returned if key not exists or value is invalid
    type=null (const)
    Set to an Artaengine type constant such as "INT", "T::INT", "T::EMAIL", etc. to validate or cast the returned value

Returns

mixed
The value set to the key or the default-value/"null" if key not exists

__get

mixed __get(string key)

Get a value from $_GET.

Arguments

    key (string)
    The key to get it's value

Returns

mixed
The value set to the key or "null" if key not exists

__isset

bool __isset(key string)

Check if a key exists in $_GET an is not null.

Arguments

    string (key)
    Key to be checked

Returns

bool
true=key exists and is nut null

__set

void __set(string key, mixed val)

Set a value to the $_GET array.

Arguments

    key (string)
    Key to set the value to
    val (mixed)
    Value to be set

Returns

void

__unset

void __unset(string key)

Unset key.

Arguments

    key (string)
    Key to unset

Returns

void