This class provides the most basic collection, containing base objects.
It has functionality to :
- add objects
- remove objects
- set name of an object (rename)
- get the names of all objects in the collection
- get an object from the collection
- get all objects in the collection
- return number of objects in collection
Methods
Constructor, initialises an instance of Formaid_TableRows collection
__construct() : void
Adds a new instance to the collection
add(object $obj) : void
If the object is of the Formaid_TableRow class,
add it to the collection.
Parameters
$obj
object
Formaid_TableRow instance
Displays all objects in the collection
display() : void
Inherited
inherited_from |
\Formaid_Collection::display() |
Get display seperator
getDisplayListSeparator() : string
Inherited
inherited_from |
\Formaid_Collection::getDisplayListSeparator() |
Returns
string
String separating columns
Get display prefix
getDisplayPrefix() : string
Inherited
inherited_from |
\Formaid_Collection::getDisplayPrefix() |
Returns
string
Prefix string when displaying collection items
Generate formatted string of all objects
getDisplayString() : string
Inherited
A displaystring is generated from all objects in the collection,
all empty strings are removed and the remaining ones are
chained together with the listSeparator.
inherited_from |
\Formaid_Collection::getDisplayString() |
Returns
string
Get display suffix
getDisplaySuffix() : string
Inherited
inherited_from |
\Formaid_Collection::getDisplaySuffix() |
Returns
string
Suffix string when displaying collection items
Returns name of the object
getName(string $name) : string
Inherited
inherited_from |
\Formaid_Collection::getName() |
Parameters
Returns
string
object name
Returns names of all objects in collection
getNames() : array
Inherited
inherited_from |
\Formaid_Collection::getNames() |
Returns
array
object names
Returns object
getObject(string $name) : object
Inherited
inherited_from |
\Formaid_Collection::getObject() |
Parameters
Returns
object
Returns all objects in collection
getObjects() : array
Inherited
inherited_from |
\Formaid_Collection::getObjects() |
Returns
array
objects
Checks if name of the selected object is empty
isNameEmpty(string $name) : bool
Inherited
inherited_from |
\Formaid_Collection::isNameEmpty() |
Parameters
Returns
bool
true if empty
Returns number of objects in collection
numItems() : int
Inherited
inherited_from |
\Formaid_Collection::numItems() |
Returns
int
number of objects in collection
Removes the object from the collection
remove(string $name) : void
Inherited
inherited_from |
\Formaid_Collection::remove() |
Parameters
Set display pre- and suffix
setDisplayAffixes(string $prefix, string $suffix) : void
Inherited
inherited_from |
\Formaid_Collection::setDisplayAffixes() |
Parameters
$prefix
string
prefix string when displaying collection items
$suffix
string
suffix string when displaying collection items
Set display seperator for list mode
setDisplayListSeparator(string $separator) : void
Inherited
inherited_from |
\Formaid_Collection::setDisplayListSeparator() |
Parameters
$separator
string
string separating columns
Set display prefix
setDisplayPrefix(string $prefix) : void
Inherited
inherited_from |
\Formaid_Collection::setDisplayPrefix() |
Parameters
$prefix
string
prefix string when displaying collection items
Set display suffix
setDisplaySuffix(string $suffix) : void
Inherited
inherited_from |
\Formaid_Collection::setDisplaySuffix() |
Parameters
$suffix
string
suffix string when displaying collection items
Sets new name for the object
setName(string $name, string $new_name) : void
Inherited
inherited_from |
\Formaid_Collection::setName() |
Parameters
Show all objects in collection
show() : void
Inherited
The show method of every object is called.
These functions print the object (name, value, ...) to stdout.
inherited_from |
\Formaid_Collection::show() |
Add pre- and suffixes to display string
addDisplayAffixes(string $displayString) : string
Inherited
The pre- and suffix should only be displayed when at least one item
is displayed.
inherited_from |
\Formaid_Collection::addDisplayAffixes() |
Parameters
$displayString
string
String with collection items to be displayed
Returns
string
String with added affixes
Callback method used by getDisplayString()
callbackDisplayString(object $object) : string
InheritedStatic
It calls the getDisplayString() method of the instance
static |
|
inherited_from |
\Formaid_Collection::callbackDisplayString() |
Parameters
$object
object
Instance to apply the method to
Returns
string
Displaystring of object
Properties
$collection : array
Inherited
access |
protected |
inherited_from |
\Formaid_Collection::$$collection |
$_displayListSeparator : string
Inherited
access |
private |
inherited_from |
\Formaid_Collection::$$_displayListSeparator |
$_displayPrefix : string
Inherited
access |
private |
inherited_from |
\Formaid_Collection::$$_displayPrefix |
$_displaySuffix : string
Inherited
access |
private |
inherited_from |
\Formaid_Collection::$$_displaySuffix |