Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcConsoleArguments

ConsoleTools::ezcConsoleArguments

Class ezcConsoleArguments

Collection class for ezcConsoleArgument objects. Used in ezcConsoleInput.

Source for this file: /ConsoleTools/src/input/arguments.php

Implements interfaces:

  • ArrayAccess (internal interface)
  • Iterator (internal interface)
  • Countable (internal interface)
Version:   //autogen//

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.

Implementation of:
Method Description
Countable::count

current

ezcConsoleArgument current( )

Returns the currently selected argument from the list.

Used by foreach-Loops.

Implementation of:
Method Description
Iterator::current

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.

Implementation of:
Method Description
Iterator::key

next

Advances the internal pointer to the next argument and returns it.

Used by foreach-Loops.

Implementation of:
Method Description
Iterator::next

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.
Exceptions:
Type Description
ezcBaseValueException If the provided offset is neither an integer, nor a string.
Implementation of:
Method Description
ArrayAccess::offsetExists

offsetGet

ezcConsoleArgument offsetGet( string|integer $offset )

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.
Exceptions:
Type Description
ezcBaseValueException If the provided offset is neither an integer, nor a string.
Implementation of:
Method Description
ArrayAccess::offsetGet

offsetSet

void offsetSet( int $offset , ezcConsoleArgument $value )

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.
Exceptions:
Type 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.
Implementation of:
Method Description
ArrayAccess::offsetSet

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.
Exceptions:
Type Description
ezcBaseValueException If a non numeric row offset is used.
Implementation of:
Method Description
ArrayAccess::offsetUnset

rewind

ezcConsoleArgument rewind( )

Rewinds the internal pointer to the first argument and returns it.

Used by foreach-Loops.

Implementation of:
Method Description
Iterator::rewind

valid

bool valid( )

Checks if the current position is valid.

Used by foreach-Loops.

Implementation of:
Method Description
Iterator::valid
Documentation generated by phpDocumentor 1.4.3