Public Member Functions | |
System ($id) | |
Class constructor. | |
fillWithPost () | |
Fill in the system using HTTP POST. | |
fillWithDatabase () | |
Fill in the system using the database. | |
getField ($name) | |
Get a field. | |
addField ($name, $description, $type, $value="", $width="20") | |
Add a field. | |
exists () | |
Checks if the System already exists. | |
save ($overwrite) | |
Save the system in the database. | |
delete () | |
Remove the system from the database. | |
html () | |
Output the system as an HTML form. | |
Private Member Functions | |
fill ($array) | |
Fill the System using values from an array. | |
Private Attributes | |
$fields = array() | |
$exists = null |
This class is an abstraction layer for the system table in the MySQL database.
System::System | ( | $ | id | ) |
Class constructor.
id | The id number of the system. This can be null for new systems. |
System::fillWithPost | ( | ) |
Fill in the system using HTTP POST.
This function will fill in the System using variables from $_POST.
System::fillWithDatabase | ( | ) |
Fill in the system using the database.
This function will fill in all fields using data from the database.
System::fill | ( | $ | array | ) | [private] |
System::getField | ( | $ | name | ) |
System::addField | ( | $ | name, | |
$ | description, | |||
$ | type, | |||
$ | value = "" , |
|||
$ | width = "20" | |||
) |
Add a field.
This will add a new field to the system.
name | The name of the field. | |
description | A descriptive text for the field. | |
type | The HTML type of the field. | |
value | Initial value of the field. | |
width | The width the field will have in HTML. |
System::exists | ( | ) |
System::save | ( | $ | overwrite | ) |
Save the system in the database.
This will either INSERT or UPDATE the system in the database.
System::delete | ( | ) |
Remove the system from the database.
This function will DELETE the system from the database.
System::html | ( | ) |
System::$fields = array() [private] |
System::$exists = null [private] |