Pommo_Groups::members PHP Method

members() public method

returns sorted/ordered/limited member IDs -- scoped to current group member IDs
public members ( $p = [], $filter = ['field' => null, 'string' => null] )
    function members($p = array(), $filter = array('field' => null, 'string' => null))
    {
        require_once Pommo::$_baseDir . 'classes/Pommo_Subscribers.php';
        if (is_array($this->_memberIDs)) {
            $p['id'] =& $this->_memberIDs;
        } else {
            $p['status'] = $this->_status;
        }
        return Pommo_Subscribers::get($p, $filter);
    }

Usage Example

Example #1
0
}
// Calculate the offset
$start = $state['limit'] * $state['page'] - $state['limit'];
if ($start < 0) {
    $start = 0;
}
/**********************************
	RECORD RETREVIAL
*********************************/
// Normalize sort column to match DB column
if ($state['sort'] == 'registered' || $state['sort'] == 'touched') {
    $state['sort'] = 'time_' . $state['sort'];
} elseif (substr($state['sort'], 0, 1) == 'd') {
    $state['sort'] = substr($state['sort'], 1);
}
// fetch subscribers for this page
$subscribers = $group->members(array('sort' => $state['sort'], 'order' => $state['order'], 'limit' => $state['limit'], 'offset' => $start));
/**********************************
	OUTPUT FORMATTING
*********************************/
// format subscribers for JSON output to jqGrid
$subOut = array();
foreach ($subscribers as $s) {
    $sub = array('id' => $s['id'], 'email' => $s['email'], 'touched' => $s['touched'], 'registered' => $s['registered'], 'ip' => $s['ip']);
    foreach ($s['data'] as $key => $d) {
        $sub['d' . $key] = $d;
    }
    array_push($subOut, $sub);
}
$json->add(array('page' => $state['page'], 'total' => $state['pages'], 'records' => $group->_tally, 'rows' => $subOut));
$json->serve();
All Usage Examples Of Pommo_Groups::members