Ejemplo n.º 1
0
 function &df_get_records($table, $query = null, $start = null, $limit = null, $preview = true)
 {
     import('Dataface/QueryTool.php');
     $app = Dataface_Application::getInstance();
     if ($query === null and $start === null and $limit === null) {
         $queryTool = Dataface_QueryTool::loadResult($table);
     } else {
         if ($query === null or !$query) {
             $query = array();
         }
         if ($start !== null) {
             $query['-skip'] = $start;
         }
         if ($limit !== null) {
             $query['-limit'] = $limit;
         }
         $queryTool = new Dataface_QueryTool($table, null, $query);
     }
     $queryTool->loadSet('', false, false, $preview);
     $it = $queryTool->iterator();
     return $it;
 }