The Base VO has a number of methods that assist in reading forms. Another method that could be
implemented here might be a date formatting method. Different databases return date values in
many different formats. To keep consistency, you may want to do some string manipulation with
the date values to keep them all looking the same.
The Extended Value Object
The VehicleVO class has five properties that reflect the five columns in the vehicles table.
A default constructor exists to create an empty VO or if given arguments, a VO filled with data:
// create a new VO
function VehicleVO($vehicleid= 0, $year= "", $make= "",
$model= "", $color= "", $price= 0.00)
$this->vehicleid = $vehicleid;
$this->year = $year;
$this->make = $make;
$this->model = $model;
$this->color = $color;
$this->price = $price;
Other methods the VO includes are:
function equals($vo) -
Compares itself to another VehicleVO object. Returns true or false.
function copy($vo) -
Copies the contents of another VehicleVO object.
function readForm() -
Reads values from the $_POST array.
function readQuery() -
Reads values from the $_GET array.
function toXML() -
Returns a string that contains it's data represented as an XML node.
Returns a string that contains a delimited line of data.