Example #1
0
 public function pageListBody($p, $z)
 {
     $where = Filter::jsonToSql($_GET['filterData']);
     $sql = "SELECT\n\t\t\t\t\t*\n\t\t\t\tfrom\n\t\t\t\t\trequest\n\t\t\t\twhere\n\t\t\t\t\t{$where}";
     $requests = DbObject::_findBySql('request', $sql, array());
     $this->assign('requests', $requests);
     $this->layout = false;
     $this->display('list_body');
 }
Example #2
0
 public function pageQuery()
 {
     $jane = DbObject::_getOne('PersonStuff', array('firstname' => 'Jane', 'lastname' => 'Doe'));
     $all = DbObject::_find('PersonStuff');
     $this->assign('all', $all);
     $odd = DbObject::_findByWhere('PersonStuff', "id % 2 == 0", array());
     $this->assign('odd', $odd);
     $sqled = DbObject::_findBySql('PersonStuff', "select id from person_stuff where firstname like 'J%'", array());
     $this->assign('sqled', $sqled);
     $one = DbObject::_findOne('PersonStuff', array('firstname' => 'Jane'));
     $this->assign('one', $one);
 }
Example #3
0
 public static function getDrafts()
 {
     $sql = "SELECT * from entry where published_date is null order by id desc";
     $entries = DbObject::_findBySql('Entry', $sql, array());
     return $entries;
 }