< DynamicList > Protocol Reference

Abstraction for dynamic lists. More...

List of all members.

Public Member Functions

 DynamicList ($identifier, $title=null, $width=500)
 Class constructor.
 fillWithPost ()
 Fill in the list using HTTP POST.
 fillWithDatabase ()
 Fill in the list using the database.
 addItem ($key, $value)
 Add an item.
 deleteItem ($key)
 Remove an item.
 save ()
 Save the list.
 databaseItemExists ($itemId, $value)
 Checks if the given item exist.
 isEmpty ()
 Checks if the list is empty.
 html ()
 Output the list in HTML.

Protected Member Functions

 databaseInsertItem ($value)
 Insert a new item.
 databaseUpdateItem ($itemId, $newValue)
 Update an existing item.
 databaseDeleteItemsExcluding ($idArray)
 Delete existing item(s).

Protected Attributes

 $items = array()
 $identifier
 $title
 $width
 $emptyListMessage
 An message saying the list is empty.
 $alreadyExistsMessage
 An message saying the item already exists.


Detailed Description

Abstraction for dynamic lists.

This class is an abstraction layer for dynamic lists in HTML forms.


Member Function Documentation

DynamicList-p::DynamicList ( identifier,
title = null,
width = 500 
)

Class constructor.

The class constructor.

Parameters:
identifier The unique identifier of the list.
title The title of the dynamic list which the final Table will have.
See also:
Table

DynamicList-p::fillWithPost (  ) 

Fill in the list using HTTP POST.

This function will fill in the System using variables from $_POST.

Returns:
Always returns true.

DynamicList-p::fillWithDatabase (  )  [abstract]

Fill in the list using the database.

This function is responsible for filling in the list using data from the database.

Returns:
boolean indicating success or failure.
See also:
Database

DynamicList-p::addItem ( key,
value 
)

Add an item.

This function adds an item. key The key of the new item.

Parameters:
value The value of the new item.

DynamicList-p::deleteItem ( key  ) 

Remove an item.

This function removes an item.

Parameters:
key The key of the item to be deleted.

DynamicList-p::save (  ) 

Save the list.

This function will call insert() or update() to save the list.

Returns:
Boolean true or false indicating success of failure.

DynamicList-p::databaseItemExists ( itemId,
value 
) [abstract]

Checks if the given item exist.

Checks if the given item already exists in the database.

Parameters:
itemId The itemId to search for.
value The item value to search for.
Returns:
Boolean true or false.

DynamicList-p::databaseInsertItem ( value  )  [abstract, protected]

Insert a new item.

This function will insert a new item with value $value in the database.

Parameters:
value The value to be inserted.

DynamicList-p::databaseUpdateItem ( itemId,
newValue 
) [abstract, protected]

Update an existing item.

This function will update an existing item in the database with $newValue.

Parameters:
itemId The id number of the item.
newValue The new value of the item.

DynamicList-p::databaseDeleteItemsExcluding ( idArray  )  [abstract, protected]

Delete existing item(s).

This function is responsible for removing item(s) from the database.

Parameters:
idArray An array containing id's which NOT to delete.

DynamicList-p::isEmpty (  ) 

Checks if the list is empty.

Returns true if the list is empty.

Returns:
Boolean true or false.

DynamicList-p::html (  ) 

Output the list in HTML.

This function will output the list in a HTML table.


Member Data Documentation

DynamicList-p::$items = array() [protected]

DynamicList-p::$identifier [protected]

DynamicList-p::$title [protected]

DynamicList-p::$width [protected]

DynamicList-p::$emptyListMessage [protected]

An message saying the list is empty.

DynamicList-p::$alreadyExistsMessage [protected]

An message saying the item already exists.


The documentation for this protocol was generated from the following file:
Generated on Sun Oct 21 06:49:25 2007 for phpSystemManager by  doxygen 1.5.2