Tina4Stack  v1.0.1
The Tina4 Stack

Extending your own classes with Olga

Olga enables the developer to use classes as data stores for data, these objects can be mapped back to a database which Olga will use to save or restore data from If you run xcache on your system, Olga will automatically persist these objects in memory making the load on the server very light.

We could create a Pet object, all classes need to have an id for the system to reference it by from memory

class Pet extends Olga {
var $id;
var $name;
var $type;
var $mapping = Array([ "table" => "tbl_pet",
"fields" => [
"id" => ["field" => "pet_id"],
"name" => ["field" => "pet_name"],
"type" => ["field" => "pet_type"]
]
]);
}

We could then create a collection of pets which would use the Pet object as an array object

class Pet extends Olga {
var $mapping = Array([ "table" => "tbl_pet",
"object" => "Pet"
]);
}