public function getList($module, $where = array(), $limit = 100, $offset = 0, $deleted = 0)
    {
        $this->getLogger()->debug($this->logPrefix
            . "__getList : module = $module | offset = $offset | limit = $limit");

        $records = array();
        // Get the beans and build the WHERE
        $oBeans = $this->getBean($module);

        if (count($where) > 0) {
            $where = "{$oBeans->table_name}." . implode(" AND {$oBeans->table_name}.", $where);
        } else {
            $where = '';
        }
        $this->getLogger()->debug($this->logPrefix . "I'll add the where: $where");

        // First the deleted if asked
        $aDeletedBeans = array();
        if ($deleted == 1) {
            $aDeletedBeans = $oBeans->get_list('', $where, $offset, $limit, $limit, 1);
            $aDeletedBeans = $aDeletedBeans['list'];
            $limit-= count($aDeletedBeans);
        }
        $this->getLogger()->debug($this->logPrefix . '__getList : got ' . count($aDeletedBeans) . ' deleted records.');

        // Get the non-deleted rows if I have less than limit - deleted retrieved
        $aNotDeletedBeans = array();
        if ($limit > 0) {
            $aNotDeletedBeans = $oBeans->get_list('', $where, $offset, $limit, $limit, 0);
            $aNotDeletedBeans = $aNotDeletedBeans['list'];
        }
        $this->getLogger()->debug($this->logPrefix
            . '__getList : got ' . count($aNotDeletedBeans) . ' NOT deleted records.');

        // Merge everything
        $aBeans = array_merge($aNotDeletedBeans, $aDeletedBeans);

        $this->getLogger()->debug($this->logPrefix
            . '__getList : got ' . count($aBeans) . " records (deleted = $deleted)");
        // change the deleted value because it's not the same for getBean
        $deleted = ($deleted == 1 ? false : true);
        foreach ($aBeans as $oBean) {
            // ReRetrieve to have the fetched row
            // It's not the best way but I need raw data
            $sugarId = $oBean->id;
            $oBean = $this->getBean($module, $sugarId, true, $deleted);
            $records[] = $oBean;

            // Clean Memory
            $this->cleanMemory();
        }

        $this->getLogger()->debug($this->logPrefix . '__getList : Sending back ' . count($records) . ' records');

        return $records;
    }