Put

Wrapper for HTTP PUT method. 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->Put->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
Put.php
Implements
IRequestArray
Depends on
Request
Since
1.2.2

Static Methods

clear

void Put::clear()

Empty PUT.

Returns

void

get

mixed Put::get(string key, mixed default=null, const type=null)

Get a value from PUT.

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

has

bool Put::has(string key)

Check if a key exists in PUT.

Arguments

    key (string)
    Key to be checked

Returns

bool
true=key exists

hasValue

bool Put::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 Put::like(string key)

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

Arguments

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

Returns

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

remove

void Put::remove([string] key)

Remove key(s).

Arguments

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

Returns

void

set

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

Set a value to the PUT object.

Arguments

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

Returns

void

with

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

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

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

__get

mixed __get(string key)

Get a value from PUT.

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(string key)

Check if a key exists in PUT an is not null.

Arguments

    key (string)
    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 PUT object.

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