Public Member Functions | |
OS ($id) | |
Class constructor. | |
fillWithPost () | |
Fill in the operating system using HTTP POST. | |
fillWithDatabase () | |
Fill in the operating system using the database. | |
getField ($name) | |
Get a field. | |
addField ($name, $description, $type, $value="", $width="20") | |
Add a field. | |
exists () | |
Checks if the operating system already exists. | |
save ($overwrite) | |
Save the operating system in the database. | |
delete () | |
Remove the operating system from the database. | |
html () | |
Output the operating system as an HTML form. | |
Private Member Functions | |
fill ($array) | |
Fill the operating system using values from an array. | |
Private Attributes | |
$fields = array() | |
$versions = null | |
$exists = null |
This class is an abstraction layer for the os and version table in the MySQL database.
OS::OS | ( | $ | id | ) |
Class constructor.
id | The id number of the operating system. This can be null for new operating systems. |
OS::fillWithPost | ( | ) |
Fill in the operating system using HTTP POST.
This function will fill in the operating system using variables from $_POST.
OS::fillWithDatabase | ( | ) |
Fill in the operating system using the database.
This function will fill in all fields using data from the database.
OS::fill | ( | $ | array | ) | [private] |
Fill the operating system using values from an array.
This fill fill in the operating system looking for key/values inside an array, and create it's VersionList.
OS::getField | ( | $ | name | ) |
OS::addField | ( | $ | name, | |
$ | description, | |||
$ | type, | |||
$ | value = "" , |
|||
$ | width = "20" | |||
) |
Add a field.
This will add a new field to the operating 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. |
OS::exists | ( | ) |
Checks if the operating system already exists.
Returns true if the operating system already exists in the database.
OS::save | ( | $ | overwrite | ) |
Save the operating system in the database.
This will either INSERT or UPDATE the operating system in the database.
OS::delete | ( | ) |
Remove the operating system from the database.
This function will DELETE the operating system from the database.
OS::html | ( | ) |
OS::$fields = array() [private] |
OS::$versions = null [private] |
OS::$exists = null [private] |