本文整理汇总了PHP中Participant::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Participant::fetchAll方法的具体用法?PHP Participant::fetchAll怎么用?PHP Participant::fetchAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Participant
的用法示例。
在下文中一共展示了Participant::fetchAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: channel_server_start
function channel_server_start()
{
$db = sr_pdo();
$result = array();
try {
$room_list = Room::fetchAll();
foreach ($room_list as $room) {
channel_destroyed_log($room);
}
$participant_list = Participant::fetchAll();
foreach ($participant_list as $p) {
channel_client_disconnected_log($p);
}
Room::delete_all($db);
Participant::delete_all($db);
$result['result'] = 0;
echo json_encode($result);
} catch (PDOException $e) {
$result['result'] = 1;
$result['msg'] = 'Server error. ' . $e->getMessage();
echo json_encode($result);
}
}
示例2: searchAction
public function searchAction()
{
//display only active users with their assigned expertise
$request = $this->getRequest();
$params = $this->namespace->searchParams;
$formValues = $this->namespace->formValues;
$userTable = new User();
$valueTable1 = new ValueList();
$valueTable2 = new ValueList();
$select = $userTable->getAdapter()->select();
$tableAdapter = $userTable->getAdapter();
$select->from(array('user' => $userTable->getTableName()));
//XXX remove leftJoin, only Alpha
$select->joinLeft(array('val1' => ValueList::TABLE_NAME), 'user.' . User::COL_INSTITUTION . '=' . 'val1.' . ValueList::COL_ID, array('Institution' => ValueList::COL_NAME));
$select->joinLeft(array('val2' => ValueList::TABLE_NAME), 'user.' . User::COL_COUNTRY . '=' . 'val2.' . ValueList::COL_ID, array('Country' => ValueList::COL_NAME));
$select->joinLeft(array('userHasExpe' => UserHasExpertise::TABLE_NAME), 'user.' . User::COL_ID . '=' . 'userHasExpe.' . UserHasExpertise::COL_USER_ID, array('expertiseId' => UserHasExpertise::COL_EXPE_ID));
$select->joinLeft(array('expe' => Expertise::TABLE_NAME), 'userHasExpe.' . UserHasExpertise::COL_EXPE_ID . '=' . 'expe.' . Expertise::COL_ID, array('eSpec' => Expertise::COL_SPECIES, 'eArea' => Expertise::COL_AREA, 'eSubj' => Expertise::COL_SUBJECT));
$select->where('user.' . User::COL_ACTIVE . ' = ?', 1);
//echo $select.'<br>';
//list details
//handle multi select/multi checkbox values
//concatenate strings and decorate with HTML tags for list presentation
if ($params['listDetails'] == 1) {
$rowSet = $tableAdapter->fetchAll($select);
if (count($rowSet) > 0) {
$userHasExpAsArray = array();
foreach ($rowSet as $row) {
if (!isset($userHasExpAsArray[$row[User::COL_ID]])) {
$userHasExpAsArray[$row[User::COL_ID]] = '';
}
if ($row['expertiseId'] != NULL) {
//$attrConcat = '<td>'.$row['eSpec'].','.$row['eArea'].','.$row['eSubj'].'</td>';
$attrConcat = '<li>' . $row['eSpec'] . ',' . $row['eArea'] . ',' . $row['eSubj'] . '</li>';
$userHasExpAsArray[$row[User::COL_ID]] = $userHasExpAsArray[$row[User::COL_ID]] . $attrConcat;
}
}
foreach ($userHasExpAsArray as &$expList) {
//$expList = "<table border = 'solid'><tr>".$expList.'</tr></table>';
$expList = '<ul>' . $expList . '</ul>';
}
$this->view->userHasExpAsArray = $userHasExpAsArray;
}
}
//handle AND/OR search
if ($params['kind'] == 'and') {
foreach ($formValues as $key => $value) {
if ($key != null && $value != null && $key != 'kind' && $key != 'submit' && $key != 'listDetails') {
if ($key == UserHasExpertise::COL_EXPE_ID) {
//$tableRow = $tableAdapter->quoteIdentifier($key);
$partStatement = $tableAdapter->quoteInto('userHasExpe.' . UserHasExpertise::COL_EXPE_ID . ' = ?', $value);
$select->where($partStatement);
} elseif ($key == User::COL_COUNTRY || $key == User::COL_INSTITUTION) {
$tableRow = $tableAdapter->quoteIdentifier($key);
$partStatement = $tableAdapter->quoteInto($tableRow . ' = ?', $value);
$select->where($partStatement);
} else {
$tableRow = $tableAdapter->quoteIdentifier($key);
$partStatement = $tableAdapter->quoteInto($tableRow . ' LIKE ?', '%' . $value . '%');
$select->where($partStatement);
}
}
}
}
if ($params['kind'] == 'or') {
$orWhere = '';
foreach ($formValues as $key => $value) {
if ($key != null && $value != null && $key != 'kind' && $key != 'submit' && $key != 'listDetails') {
if ($key == UserHasExpertise::COL_EXPE_ID) {
//$tableRow = $tableAdapter->quoteIdentifier($key);
$partStatement = $tableAdapter->quoteInto('userHasExpe.' . UserHasExpertise::COL_EXPE_ID . ' = ?', $value);
} elseif ($key == User::COL_COUNTRY || $key == User::COL_INSTITUTION) {
$tableRow = $tableAdapter->quoteIdentifier($key);
$partStatement = $tableAdapter->quoteInto($tableRow . ' = ?', $value);
} else {
$tableRow = $tableAdapter->quoteIdentifier($key);
$partStatement = $tableAdapter->quoteInto($tableRow . ' LIKE ?', '%' . $value . '%');
}
//append the where to the "where or where" container
if (isset($partStatement)) {
if ($orWhere == '') {
$orWhere = $partStatement;
} else {
$orWhere = $orWhere . ' OR ' . $partStatement;
}
}
unset($partStatement);
}
}
//finally append the where to the select(whole metadata)
if ($orWhere != '') {
$select->where($orWhere);
}
}
//filter double datasets caused by multiple meta data
$select->group('user.' . User::COL_ID);
//for setting ws-manager filter low user roles
if ($this->defaultNamespace->callingAction == 'workshop/edit/update') {
$select->where('(user.' . User::COL_ROLE . ' = ?', 'ws-manager');
$select->orWhere('user.' . User::COL_ROLE . ' = ?)', 'admin');
}
//.........这里部分代码省略.........
示例3: countParticipants
private function countParticipants()
{
$parti = new Participant();
$where = $parti->getAdapter()->quoteInto(Participant::COL_CE_ID . ' = ?', $this->callingCeId);
$rowSet = $parti->fetchAll($where);
return count($rowSet);
}