Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2011 Rev 2012
Línea 298... Línea 298...
298
        $update->where->equalTo('id', $feed_id);
298
        $update->where->equalTo('id', $feed_id);
Línea 299... Línea 299...
299
        
299
        
300
        return $this->executeUpdate($update);
300
        return $this->executeUpdate($update);
Línea 301... Línea 301...
301
    }
301
    }
302
 
302
 
303
     /**
-
 
304
     *
-
 
305
     * @param int $companyId
-
 
306
     * @param string $search
-
 
307
     * @param int $page
-
 
308
     * @param int $records_per_page
-
 
309
     * @param string $order_field
303
    /**
310
     * @param string $order_direction
304
     *
311
     * @return Paginator
305
     * @return Feed
312
     */
306
     */
313
    public function fetchAllDataTableByMytQuestion($search, $page = 1, $records_per_page = 10, $order_field= 'name', $order_direction = 'ASC')
307
    public function fetchAllByMytQuestion()
-
 
308
    {
314
    {
309
        $prototype = new Feed();
315
        $prototype = new Feed();
310
        
316
        $select = $this->sql->select(self::_TABLE);
311
        $select = $this->sql->select(self::_TABLE);
-
 
312
        $select->where->equalTo('type', Feed::TYPE_MYT_QUESTION);
Línea 317... Línea -...
317
        $select->where->equalTo('type', Feed::TYPE_MYT_QUESTION);
-
 
318
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
-
 
319
        
-
 
320
        if($search) {
-
 
321
            $select->where->like('title', '%' . $search . '%');
-
 
322
        }
-
 
323
        $select->order($order_field . ' ' . $order_direction);
-
 
324
        
-
 
325
        //echo $select->getSqlString($this->adapter->platform); exit;
313
        $select->where->notEqualTo('status', Feed::STATUS_DELETED);
326
        
-
 
327
        $hydrator   = new ObjectPropertyHydrator();
-
 
328
        $resultset  = new HydratingResultSet($hydrator, $prototype);
-
 
329
        
-
 
330
        $adapter = new DbSelect($select, $this->sql, $resultset);
-
 
331
        $paginator = new Paginator($adapter);
-
 
332
        $paginator->setItemCountPerPage($records_per_page);
-
 
333
        $paginator->setCurrentPageNumber($page);
-
 
334
        
314
        $select->order('title');
Línea 335... Línea 315...
335
        
315
        
336
        return $paginator;
316
        return $this->executeFetchAllObject($select, $prototype);