Path

ez components / documentation / api reference / 2008.2.1 / consoletools


eZ Components 2008.2.1

ConsoleTools: ezcConsoleOutputFormats

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcConsoleOutputFormats

Class to store the collection for formating classes. [source]

Implemented Interfaces

  • Iterator (internal interface)
  • Countable (internal interface)

This class stores objects of ezcConsoleOutputFormat, which represents a format option set for ezcConsoleOutput.
 1.  // New ezcConsoleOutput
 2.  // $output->format is instance of ezcConsoleOutputFormats.
 3.   $output new ezcConsoleOutput();
 4.  
 5.  // Default format - color = blue
 6.   $output->formats->default->color 'blue';
 7.  // Default format - weight = bold
 8.   $output->formats->default->style array'bold' );
 9.  
10.  // New format "important" - color = red
11.   $output->formats->important->color 'red';
12.  // Format "important" - background color = black
13.   $output->formats->important->bgcolor 'black';

Member Variables

protected array(ezcConsoleOutputFormat) $formats = array()
Array of ezcConsoleOutputFormat.

Method Summary

public ezcConsoleOutputFormats __construct( )
Create a new ezcConsoleOutputFormats object.
public void count( )
Returns the number of registered formats.
public ezcConsoleOutputFormat current( )
Returns the current Iterator value.
public string key( )
Returns the current Iterator key.
public ezcConsoleOutputFormat|bool next( )
Advances the Iterator to the next element.
public ezcConsoleOutputFormat rewind( )
Resets the Iterator to the first element.
public bool valid( )
Checks if the current Iterator position is still valid.
public ezcConsoleOutputFormat __get( $formatName )
Read access to the formats.
public bool __isset( $formatName )
Property isset access.
public void __set( $formatName, $val )
Write access to the formats.

Methods

__construct

ezcConsoleOutputFormats __construct( )
Create a new ezcConsoleOutputFormats object.
Creates a new, empty object of this class. It also adds a default format.

count

void count( )
Returns the number of registered formats.
Implementation of Countable::count().

current

Returns the current Iterator value.
Implementation of Iterator::current().

key

string key( )
Returns the current Iterator key.
Implementation of Iterator::key().

next

ezcConsoleOutputFormat|bool next( )
Advances the Iterator to the next element.
Implementation of Iterator::next().

rewind

Resets the Iterator to the first element.
Implementation of Iterator::rewind().

valid

bool valid( )
Checks if the current Iterator position is still valid.
Implementation of Iterator::valid().

__get

ezcConsoleOutputFormat __get( string $formatName )
Read access to the formats.
Formats are accessed directly like properties of this object. If a format does not exist, it is created on the fly (using default values),

Parameters

Name Type Description
$formatName string  

__isset

bool __isset( string $formatName )
Property isset access.

Parameters

Name Type Description
$formatName string Name of the property.

__set

void __set( string $formatName, ezcConsoleOutputFormat $val )
Write access to the formats.
Formats are accessed directly like properties of this object. If a format does not exist, it is created on the fly (using default values),

Parameters

Name Type Description
$formatName string  
$val ezcConsoleOutputFormat The format defintion.

Last updated: Mon, 09 Feb 2009