Data objects

From The Smartest Wiki
Jump to: navigation, search

Like many PHP-based software packages, Smartest makes use of a relational database via MySQL.

To make CRUD (Create, Retrieve, Update, Delete) queries simpler and faster, and to save the developer from having to write SQL every time, Smartest uses what is known as an active record system.

Each table within the Smartest database has an automatically generated class associated with it for basic get/set functionality. All of these classes inherit this functionality from the class SmartestDataObject.

Each automatically generated class is then extended further, into a class that contains functionality specific to what the object is for. So pages, which are usually objects of the SmartestPage class have a publish() method, for example. These classes are known as the Basic objects.

In turn, some of these classes are then extended one more time, into what are known as Extended objects. So for instance a SmartestItemPage is an extended version of SmartestPage that is used to render Meta-pages.