Pommo_Groups::getMemberIDs PHP Method

getMemberIDs() public method

returns an array of subscriber IDs
public getMemberIDs ( $group, $status = 1, $filter = false )
    function &getMemberIDs($group, $status = 1, $filter = false)
    {
        $dbo =& Pommo::$_dbo;
        require_once Pommo::$_baseDir . 'classes/Pommo_Sql.php';
        if (empty($group['rules']) && $group['id'] != 0) {
            $o = array();
            return $o;
        }
        $query = Pommo_Sql::groupSQL($group, false, $status, $filter);
        return $dbo->getAll($query, 'assoc', 'subscriber_id');
    }

Usage Example

Example #1
0
 function __construct($groupID = NULL, $status = 1, $filter = FALSE)
 {
     $this->_status = $status;
     if (!is_numeric($groupID)) {
         // exception if no group ID was passed -- group assumes "all subscribers".
         require_once Pommo::$_baseDir . 'classes/Pommo_Subscribers.php';
         $this->_group = array('rules' => array(), 'id' => 0);
         $this->_id = 0;
         $this->_name = Pommo::_T('All Subscribers');
         $this->_memberIDs = is_array($filter) ? Pommo_Groups::getMemberIDs($this->_group, $status, $filter) : null;
         $this->_tally = is_array($filter) ? count($this->_memberIDs) : Pommo_Subscribers::tally($status);
         return;
     }
     $this->_group = current(Pommo_Groups::get(array('id' => $groupID)));
     $this->_id = $groupID;
     $this->_name =& $this->_group['name'];
     $this->_memberIDs = Pommo_Groups::getMemberIDs($this->_group, $status, $filter);
     $this->_tally = count($this->_memberIDs);
     return;
 }