Exemplo n.º 1
0
 /**
  * @covers TechG\TechGPU\DB\Mysql\TgMysqlUti::executePaginatedQuery
  */
 public function testExecutePaginatedQuery()
 {
     $queryies = $this->getSqlQueries();
     foreach ($queryies as $q) {
         $res = TgMysqlUti::executePaginatedQuery($this->getConnection(), $q['sql']);
         $this->checkPaginatedQueryResult($res, $q);
     }
 }
Exemplo n.º 2
0
 public function addFieldsInfo($res = null)
 {
     if (!$res) {
         return $this;
     }
     $fields = $res->fetch_fields();
     $fieldsInfoArray = array('field_num' => new DbgInfoItem('field_num', count($fields), DbgInfoItem::TYPE_NUMERIC), 'field_info' => new DbgInfoArrayItem('Fields', array(), array('render_type' => 'list')));
     $this->add('fields_info', new DbgInfoArrayItem('Fields info', $fieldsInfoArray, array('render_type' => 'list')));
     foreach ($fields as $field) {
         $fieldInfoArray = array('field_orgname' => new DbgInfoItem('real_name', $field->orgname, DbgInfoItem::TYPE_STRING), 'field_type' => new DbgInfoItem('type', TgMysqlUti::decodeMysqlFieldsType($field->type) . "({$field->type})", DbgInfoItem::TYPE_STRING), 'field_length' => new DbgInfoItem('length', $field->length, DbgInfoItem::TYPE_STRING), 'field_decimals' => new DbgInfoItem('decimals', $field->decimals, DbgInfoItem::TYPE_STRING), 'field_table_alias' => new DbgInfoItem('table_alias', $field->table, DbgInfoItem::TYPE_STRING), 'field_table' => new DbgInfoItem('table', $field->orgtable, DbgInfoItem::TYPE_STRING));
         $this->value['fields_info']['field_info']->add($field->name, new DbgInfoArrayItem($field->name, $fieldInfoArray, array('render_type' => 'list')));
     }
     return $this;
 }