Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 192 | Rev 538 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 192 Rev 537
Línea 150... Línea 150...
150
        
150
        
151
        $prototype = new JobDescription();
151
        $prototype = new JobDescription();
152
        return $this->executeFetchAllObject($select, $prototype);
152
        return $this->executeFetchAllObject($select, $prototype);
Línea -... Línea 153...
-
 
153
    }
-
 
154
 
-
 
155
     /**
-
 
156
     *
-
 
157
     * @param string $search
-
 
158
     * @param int $page
-
 
159
     * @param int $records_per_page
-
 
160
     * @param string $order_field
-
 
161
     * @param string $order_direction
-
 
162
     * @return Paginator
-
 
163
     */
-
 
164
    public function fetchAllDataTable($search, $page = 1, $records_per_page = 10, $order_field= 'name', $order_direction = 'ASC')
-
 
165
    {
-
 
166
        $prototype = new JobDescription();
-
 
167
        $select = $this->sql->select(self::_TABLE);
-
 
168
        $select->where->isNull('company_id');
-
 
169
        
-
 
170
        if($search) {
-
 
171
            $select->where->like('name', '%' . $search . '%');
-
 
172
        }
-
 
173
        $select->order($order_field . ' ' . $order_direction);
-
 
174
        
-
 
175
        $hydrator   = new ObjectPropertyHydrator();
-
 
176
        $resultset  = new HydratingResultSet($hydrator, $prototype);
-
 
177
        
-
 
178
        $adapter = new DbSelect($select, $this->sql, $resultset);
-
 
179
        $paginator = new Paginator($adapter);
-
 
180
        $paginator->setItemCountPerPage($records_per_page);
-
 
181
        $paginator->setCurrentPageNumber($page);
-
 
182
        
-
 
183
        
-
 
184
        return $paginator;
Línea 153... Línea 185...
153
    }
185
    }
154
 
186
 
155
    
187
    
156
    /**
188
    /**