public function grab()
 {
     parent::grab();
     $author_ids = $this->_getAuthorIds();
     $authors = AuthorManager::fetchByID($author_ids, 'id', $this->dsParamORDER);
     return (array) $authors;
 }
 /**
  * Fetch raw recipient data.
  *
  * Usage of the getSlice function, which also parses the XSLT for the name
  * and checks the email is recommended. This function is here mainly for
  * internal reasons.
  *
  * Be advised, this function returns an array of entry objects.
  *
  * @todo bugtesting and error handling
  * @return array
  */
 public function grab()
 {
     parent::grab();
     $where_and_joins = $this->getWhereJoinsAndGroup();
     $entries = EntryManager::fetchByPage($this->dsParamSTARTPAGE > 0 ? $this->dsParamSTARTPAGE : 1, $this->getSource(), $this->dsParamLIMIT >= 0 ? $this->dsParamLIMIT : NULL, $where_and_joins['where'], $where_and_joins['joins'], false, false, true, array_merge(array($this->emailField), $this->nameFields));
     // The count method of the entrymanager does not work properly, so this hack is needed :(
     $count = $this->getCount();
     $entries['total-entries'] = $count;
     $entries['total-pages'] = ceil($count / $this->dsParamLIMIT);
     $entries['remaining-pages'] = $entries['total-pages'] - $entries['current-page'];
     return $entries;
 }
    /**
     * Fetch recipient data.
     *
     * @return array
     */
    public function grab()
    {
        parent::grab();
        $this->_createTempTable();
        if ($this->newsletter_id !== NULL) {
            $where .= ' AND `d`.`email` IS NOT NULL GROUP BY `d`.`email`';
            $joins .= ' LEFT OUTER JOIN tbl_tmp_email_newsletters_sent_' . $this->newsletter_id . ' AS `n` ON `d`.`email` = `n`.`email`
						WHERE `n`.`email` IS NULL';
        } else {
            $joins .= 'GROUP BY `d`.`email`';
        }
        $limit = ' LIMIT ' . ($this->dsParamSTARTPAGE - 1) * $this->dsParamLIMIT . ', ' . $this->dsParamLIMIT;
        $rows = Symphony::Database()->fetch('SELECT `d`.`id`, `d`.`name`, `d`.`email`, `d`.`valid` from ' . $this->_tempTable . ' as `d` ' . $joins . $where . $limit);
        return $rows;
    }