Example #1
0
 public function getAllIds($limit = null, $offset = null)
 {
     if (!$this->listingProductMode) {
         return parent::getAllIds($limit, $offset);
     }
     // hack for selecting listing product ids instead entity ids
     $idsSelect = clone $this->getSelect();
     $idsSelect->reset(\Zend_Db_Select::ORDER);
     $idsSelect->reset(\Zend_Db_Select::LIMIT_COUNT);
     $idsSelect->reset(\Zend_Db_Select::LIMIT_OFFSET);
     $idsSelect->columns('lp.' . $this->getIdFieldName());
     $idsSelect->limit($limit, $offset);
     $data = $this->getConnection()->fetchAll($idsSelect, $this->_bindParams);
     $ids = array();
     foreach ($data as $row) {
         $ids[] = $row[$this->getIdFieldName()];
     }
     return $ids;
 }