当前位置: 首页>>代码示例>>PHP>>正文


PHP UserGroup::getRecordSet方法代码示例

本文整理汇总了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);
 }
开发者ID:saiber,项目名称:livecart,代码行数:9,代码来源:UserGroupTest.php

示例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;
 }
开发者ID:saiber,项目名称:livecart,代码行数:18,代码来源:UserGroupController.php

示例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);
 }
开发者ID:saiber,项目名称:livecart,代码行数:10,代码来源:UserController.php

示例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;
 }
开发者ID:saiber,项目名称:www,代码行数:35,代码来源:UserGroupController.php


注:本文中的UserGroup::getRecordSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。