Downloading data

In order to download data from the data base we have to execute the following steps:

1. Table object preparation

From the PHP level, object preparation looks like this:

$pagesDB = new pagesDB();

Where an objects name is a name of a table with DB added at the end.
A variable prepared like this $pagesDB can be used for sending queries to a data base with the help of our framework.

2. Sending inquiry

In order to perform operations on the data base you should use the proper method available for a certain table, for example:

//General methods
//Returns pages with a status equal to 0 and sorts them according to position
$deletedPages = $pagesDB->fetchAll("status=0",'position ASC','*');
//Returns page with an ID number equal to a number transferred in GET under parameter "id"
$page = $pagesDB->fetchRow("id={$this->request->getVariable('id')}");
//Updates position of images
$imagesDb->updateRow(array('position' => $position),"id = {$element['id']}");
//Specific methods for given table
//Deletes main element and its dependents
$pagesDB->deleteTreeItems($this->request->getVariable('id'));
//Downloads a list of ID numbers of pages dependent on pages with an ID number in GET
$children = $pagesDB->getDependentIdListString($this->request->getVariable('id'));

By default this method returns the data in the form on an object, you can change it so that is is returned in table form, however an object is a much more comfortable form.

Example of a result of a downloading page inquiry:
//Code will display Us the result
$pagesDB = new pagesDB();
$page = $pagesDB->fetchAll("id=423");
debugger::dprint($page);

We provide the methods to execute the inquiry, each of the tables has its own unique method, which in turn uses a set of basic methods. In order to check which method a given table uses, you have to look into the documentation or into a models code.