This site uses cookies in order for our service to work better. Learn more I understand

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);
Result
Array
(
    [0] => stdClass Object
        (
            [id] => 423
            [parentId] => 390
            [type] => 11
            [status] => 2
            [position] => 4
            [name] => Main Menu
            [content] => 
            [createTime] => 2012-09-02 09:29:06
            [updateTime] => 2012-12-10 00:32:50
            [createIP] => 127.0.0.1
            [updateIp] => ::1
            [urlKey] => menu-glowne-5
            [tpl] => simple_page.tpl
            [title] => 
            [description] => 
            [keywords] => 
            [tags] => 
            [views] => 6
            [date] => 
            [lock] => 0
            [defaultTpl] => simple_page.tpl
            [authorId] => 5
            [rate] => 0
            [ekey] => ppdhyfzknpnt
            [hasIcon] => 
            [hasImage] => 
            [langId] => 390
            [menuCssClass] => 
            [searchable] => 1
        )

)
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.  

3. Basic methods

  • select($where = null, $order = null, $what = '*',$limit = null, $groupby = null, $bindValues = array() )
  • insert(array $data = array())
  • update($column, $value, $where, $bindValues = array() )
  • updateRow($data, $where, $bindValues = array() )
  • deleteRows($where, $bindValues = array() )
  • delete($id)
  • fetchRow($where = null, $order = null, $what = '*', $bindValues = array(), $fetchType = PDO::FETCH_OBJ)
  • fetchAll($where = null, $order = null, $what = '*', $limit = null, $groupby = null, $bindValues = array(),$fetchType = PDO::FETCH_OBJ)
  • fetchTextSearch($searchText,array $columns, $where = null, $order = null, $what = '*', $limit = null, $groupby = null, $bindValues = array() )
  • fetchCount($where = null, $bindValues = array() )
  • fetchCountGroup($groupBy,$where = null,$order = null,$what = '*', $limit = null, $bindValues = array() )
  • fetchSum($sumColumn,$where = null,$order = null,$what = '*', $limit = null, $bindValues = array() )
  • fetchGroup($groupBy, $where = null, $order = null, $what = '*', $limit = null, $bindValues = array())
  • set($id,$column,$value)
  • get($id,$column)

Help Center

Do you have a technical problem?