示例#1
0
 public function main()
 {
     $type = $this->getParam('type');
     $this->setProperty('type', $type);
     $type_id = $this->dbh->getScalar('ads_types', 'ads_type_id', array('ads_type_sysname' => $type));
     $this->setFilter(['ads_type_id' => $type_id, 'ads_item_is_active' => 1]);
     if ($limit = $this->getParam('limit')) {
         $this->setLimit([0, $limit]);
     }
     if ($order = $this->getParam('order')) {
         if ($order == 'rand') {
             $this->setOrder('RAND()');
         } else {
             $this->setOrder('ads_item_order_num');
         }
     }
     parent::main();
 }
示例#2
0
 protected function main()
 {
     parent::main();
     if ($f = $this->getData()->getFieldByName('smap_id')) {
         foreach ($f as $key => $value) {
             $site = E()->getSiteManager()->getSiteByPage($value);
             $f->setRowProperty($key, 'url', E()->getMap($site->id)->getURLByID($value));
             $f->setRowProperty($key, 'base', $site->base);
         }
     }
 }
示例#3
0
 /**
  * @copydoc DBDataSet::main
  */
 protected function main()
 {
     //If we don't have such form - return recodset with error
     //Otherwise run main method
     if (!$this->formID) {
         $this->returnEmptyRecordset();
     } else {
         parent::main();
         $this->buildForm();
     }
 }