ConsoleTools: ezcConsoleArguments
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcConsoleArguments
|
Collection class for ezcConsoleArgument objects. Used in
ezcConsoleInput. [
source]
Implemented Interfaces
- ArrayAccess (internal interface)
- Iterator (internal interface)
- Countable (internal interface)
Member Variables
|
protected array(string=>ezcConsoleArgument) |
$named
= array()
Named list of arguments. |
|
protected array(ezcConsoleArgument) |
$ordered
= array()
Ordered list of arguments. |
Method Summary
|
public int |
count(
)
Returns the number of registered arguments. |
|
public ezcConsoleArgument |
current(
)
Returns the currently selected argument from the list. |
|
public string |
key(
)
Returns the key of the currently selected argument from the list. |
|
public ezcConsoleArgument |
next(
)
Advances the internal pointer to the next argument and returns it. |
|
public bool |
offsetExists(
$offset )
Returns if the given offset exists. |
|
public ezcConsoleArgument |
offsetGet(
$offset )
Returns the element with the given offset. |
|
public void |
offsetSet(
$offset, $value )
Set the element with the given offset. |
|
public void |
offsetUnset(
$offset )
Unset the element with the given offset. |
|
public ezcConsoleArgument |
rewind(
)
Rewinds the internal pointer to the first argument and returns it. |
|
public bool |
valid(
)
Checks if the current position is valid. |
Methods
count
int count(
)
Returns the number of registered arguments.
current
Returns the currently selected argument from the list.
Used by foreach-Loops.
key
string key(
)
Returns the key of the currently selected argument from the list.
Used by foreach-Loops. In contrast to the iteration direction, which is defined by the ordered list of arguments, this is the name of the argument.
next
Advances the internal pointer to the next argument and returns it.
Used by foreach-Loops.
offsetExists
bool offsetExists(
mixed
$offset )
Returns if the given offset exists.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array. Valid offsets are integers or strings. If an integer is used, it refers to the position in the command line. A string refers to the arguments name property.
Parameters
| Name |
Type |
Description |
$offset |
mixed |
The offset to check. |
Throws
| Class | Description |
ezcBaseValueException |
If the provided offset is neither an integer, nor a string. |
offsetGet
Returns the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array. Valid offsets are integers or strings. If an integer is used, it refers to the position in the command line. A string refers to the arguments name property.
Parameters
| Name |
Type |
Description |
$offset |
string|integer |
The offset to check. |
Throws
| Class | Description |
ezcBaseValueException |
If the provided offset is neither an integer, nor a string. |
offsetSet
Set the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array. In contrast to the other ArrayAccess implementations of this class, this method allows only integer keys.
Parameters
| Name |
Type |
Description |
$offset |
int |
The offset to assign an item to. |
$value |
ezcConsoleArgument |
The argument object to register. |
Throws
| Class | Description |
ezcBaseValueException |
If a non integer offset is provided. |
ezcBaseValueException |
If the provided value is not of type {@ling ezcConsoleTableRow}. |
ezcConsoleArgumentAlreadyRegisteredException |
If an argument with the given offset or name is already registered. |
offsetUnset
void offsetUnset(
int
$offset )
Unset the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array. In contrast to the other ArrayAccess implementations of this class, this method allows only integer keys.
Parameters
| Name |
Type |
Description |
$offset |
int |
The offset to unset the value for. |
Throws
| Class | Description |
ezcBaseValueException |
If a non numeric row offset is used. |
rewind
Rewinds the internal pointer to the first argument and returns it.
Used by foreach-Loops.
valid
bool valid(
)
Checks if the current position is valid.
Used by foreach-Loops.
Last updated: Mon, 21 Dec 2009