本文整理汇总了PHP中UserGroup::getRecordSet方法的典型用法代码示例。如果您正苦于以下问题:PHP UserGroup::getRecordSet方法的具体用法?PHP UserGroup::getRecordSet怎么用?PHP UserGroup::getRecordSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup::getRecordSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetAllGroups
public function testGetAllGroups()
{
$groupCount = UserGroup::getRecordSet(new ARSelectFilter())->getTotalRecordCount();
$group = UserGroup::getNewInstance('testing', 'testing');
$group->save();
$groups = UserGroup::getRecordSet(new ARSelectFilter());
$this->assertEqual($groups->getTotalRecordCount(), $groupCount + 1);
$this->assertEqual($groups->get($groupCount), $group);
}
示例2: users
public function users()
{
$id = (int) $this->request->get("id");
$response = new ActionResponse();
$availableUserGroups = array('' => $this->translate('_default_user_group'));
foreach (UserGroup::getRecordSet(new ARSelectFilter()) as $group) {
$availableUserGroups[$group->getID()] = $group->name->get();
}
$form = UserController::createUserForm($this, null, $response);
$form->setData(array_merge($form->getData(), array('UserGroup' => $id, 'ID' => 0, 'isEnabled' => 1)));
$response->set('newUser', array('UserGroup' => array('ID' => $id), 'ID' => 0, 'isEnabled' => 1));
$response->set('availableUserGroups', $availableUserGroups);
$response->set('form', $form);
$response->set('countries', array_merge(array('' => ''), $this->application->getEnabledCountries()));
$response->set("userGroupID", $id);
$this->setGridResponse($response);
return $response;
}
示例3: selectPopup
public function selectPopup()
{
$userGroups = array();
$userGroups[] = array('ID' => -2, 'name' => $this->translate('_all_users'), 'rootID' => 0);
$userGroups[] = array('ID' => -1, 'name' => $this->translate('_default_user_group'), 'rootID' => -2);
foreach (UserGroup::getRecordSet(new ARSelectFilter())->toArray() as $group) {
$userGroups[] = array('ID' => $group['ID'], 'name' => $group['name'], 'rootID' => -2);
}
return new ActionResponse('userGroups', $userGroups);
}
示例4: quickEdit
public function quickEdit()
{
$this->loadQuickEditLanguageFile();
$request = $this->getRequest();
$userID = $request->get('id');
$user = User::getInstanceByID($userID, ActiveRecordModel::LOAD_DATA, array('UserGroup'));
$f = new ARSelectFilter(new EqualsCond(new ARFieldHandle('CustomerOrder', 'userID'), $user->getID()));
$f->setOrder(new ARFieldHandle('CustomerOrder', 'dateCompleted'), 'desc');
$customerOrders = ActiveRecordModel::getRecordSet('CustomerOrder', $f, ActiveRecordModel::LOAD_REFERENCES);
$response = new ActionResponse();
$response->set('someUser', $user->toArray());
$lastOrder = false;
$ordersArray = array();
if ($customerOrders->size() > 0) {
$i = 0;
foreach ($customerOrders as $order) {
$order->loadAddresses();
$order->getShipments();
$order->loadDiscounts();
$ordersArray[$i] = $order->toArray();
$ordersArray[$i]['status_name'] = CustomerOrder::getStatusName($ordersArray[$i]['status'] ? $ordersArray[$i]['status'] : CustomerOrder::STATUS_NEW);
$i++;
}
$response->set('orders', $ordersArray);
$response->set('lastOrder', $ordersArray[0]);
}
$form = UserController::createUserForm($this, $user, $response);
$response->set('form', $form);
$availableUserGroups = array('' => $this->translate('_default_user_group'));
foreach (UserGroup::getRecordSet(new ARSelectFilter()) as $group) {
$availableUserGroups[$group->getID()] = $group->name->get();
}
$response->set('availableUserGroups', $availableUserGroups);
return $response;
}