silverorange Code


Swat.SwatCellRendererSet
/Swat/SwatCellRendererSet.php at line 18

Class SwatCellRendererSet

SwatObject
└─SwatCellRendererSet

public class SwatCellRendererSet
extends SwatObject

A collection of cell renderers with associated datafield-property mappings

Copyright:
2005-2007 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Method Summary
void

addMappingToRenderer(SwatCellRenderer renderer, SwatCellRendererMapping mapping)

Adds a single property-datafield mapping to a cell renderer already in this set.

void

addMappingsToRenderer(SwatCellRenderer renderer, array mappings)

Adds a set of datafield-property mappings to a cell renderer already in this set.

void

addRenderer(SwatCellRenderer renderer)

Adds a cell renderer to this set.

void

addRendererWithMappings(SwatCellRenderer renderer, array mappings)

Adds a cell renderer to this set with a predefined set of datafield-property mappings.

void

applyMappingsToRenderer(SwatCellRenderer renderer, mixed data_object)

Applies the property-datafield mappings to a cell renderer already in this set using a specified data object.

integer

count()

Gets the number of cell renderers in this set.

SwatCellRenderer

current()

Returns the current renderer.

integer

getCount()

Gets the number of renderers in this set.

SwatCellRenderer

getFirst()

Gets the first renderer in this set.

array

getMappingsByRenderer(SwatCellRenderer renderer)

Gets the mappings of a cell renderer already in this set.

SwatCellRenderer

getRenderer(string renderer_id)

Gets a renderer in this set by its id.

SwatCellRenderer

getRendererByPosition(integer position)

Gets a cell renderer in this set by its ordinal position.

integer

key()

Returns the key of the current renderer.

boolean

mappingsApplied()

Whether or not mappings have been applied to this cell-renderer set.

void

next()

Moves forward to the next renderer.

void

rewind()

Rewinds this iterator to the first renderer.

boolean

valid()

Checks is there is a current renderer after calls to rewind() and next().

Method Detail

/Swat/SwatCellRendererSet.php at line 146

addMappingToRenderer

public void addMappingToRenderer(SwatCellRenderer renderer, SwatCellRendererMapping mapping)

Adds a single property-datafield mapping to a cell renderer already in this set

Parameters:
renderer - the cell renderer to add the mapping to.
mapping - the mapping to add.
Throws:
if an attepmt to map a static cell renderer property is made.

/Swat/SwatCellRendererSet.php at line 117

addMappingsToRenderer

public void addMappingsToRenderer(SwatCellRenderer renderer, array mappings)

Adds a set of datafield-property mappings to a cell renderer already in this set

Parameters:
renderer - the cell renderer to add the mappings to.
mappings - an array of SwatCellRendererMapping objects.
Throws:
if an attepmt to map a static cell renderer property is made.

/Swat/SwatCellRendererSet.php at line 72

addRenderer

public void addRenderer(SwatCellRenderer renderer)

Adds a cell renderer to this set

An empty datafield-property mapping array is created for the added renderer.

Parameters:
renderer - the renderer to add.

/Swat/SwatCellRendererSet.php at line 96

addRendererWithMappings

public void addRendererWithMappings(SwatCellRenderer renderer, array mappings)

Adds a cell renderer to this set with a predefined set of datafield-property mappings

Parameters:
renderer - the renderer to add.
mappings - an array of SwatCellRendererMapping objects.
See Also:
SwatCellRendererSet::addRenderer()
SwatCellRendererSet::addMappingsToRenderer()

/Swat/SwatCellRendererSet.php at line 169

applyMappingsToRenderer

public void applyMappingsToRenderer(SwatCellRenderer renderer, mixed data_object)

Applies the property-datafield mappings to a cell renderer already in this set using a specified data object

Parameters:
renderer - the cell renderer to apply the mappings to.
data_object - an object containg datafields to be mapped onto the cell renderer.

/Swat/SwatCellRendererSet.php at line 407

count

public integer count()

Gets the number of cell renderers in this set

This satisfies the Countable interface.

Returns:
the number of cell renderers in this set.

/Swat/SwatCellRendererSet.php at line 308

current

public SwatCellRenderer current()

Returns the current renderer

Returns:
the current renderer.

/Swat/SwatCellRendererSet.php at line 392

getCount

public integer getCount()

Gets the number of renderers in this set

Returns:
the number of renderers in this set.
Deprecated:
this class now implements Countable. Use count($object) instead of $object->getCount().

/Swat/SwatCellRendererSet.php at line 371

getFirst

public SwatCellRenderer getFirst()

Gets the first renderer in this set

Returns:
the first cell renderer in this set or null if there are no cell renderers in this set.

/Swat/SwatCellRendererSet.php at line 277

getMappingsByRenderer

public array getMappingsByRenderer(SwatCellRenderer renderer)

Gets the mappings of a cell renderer already in this set

Parameters:
renderer - the cell renderer to get the mappings for.
Returns:
an array of SwatCellRendererMapping objects for the specified cell renderer.

/Swat/SwatCellRendererSet.php at line 255

getRenderer

public SwatCellRenderer getRenderer(string renderer_id)

Gets a renderer in this set by its id

Parameters:
renderer_id - the id of the renderer to get.
Returns:
the cell renderer from this set with the given id.
Throws:
if a renderer with the given $renderer_id does not exist in this set.

/Swat/SwatCellRendererSet.php at line 230

getRendererByPosition

public SwatCellRenderer getRendererByPosition(integer position)

Gets a cell renderer in this set by its ordinal position

Parameters:
position - the ordinal position of the renderer.
Returns:
the cell renderer at the specified position.
Throws:
if the requested $position is greater than the number of cell renderers in this set.

/Swat/SwatCellRendererSet.php at line 321

key

public integer key()

Returns the key of the current renderer

Returns:
the key of the current renderer

/Swat/SwatCellRendererSet.php at line 295

mappingsApplied

public boolean mappingsApplied()

Whether or not mappings have been applied to this cell-renderer set

Returns:
true if mappings have been applied to this cell renderer set and false if not.
Todo:
This method doesn't make sense since mappings are applied to renderers one at a time.

/Swat/SwatCellRendererSet.php at line 332

next

public void next()

Moves forward to the next renderer


/Swat/SwatCellRendererSet.php at line 343

rewind

public void rewind()

Rewinds this iterator to the first renderer


/Swat/SwatCellRendererSet.php at line 357

valid

public boolean valid()

Checks is there is a current renderer after calls to rewind() and next()

Returns:
true if there is a current renderer and false if there is not.

silverorange Code