ユーザー検索はデータベースアイテムリストを継承しています。DatabaseItemListクラスに関するこちらのドキュメントをご参照ください

UserListオブジェクトのインスタンスを生成する

	Loader::model('user_list');
	$ul = new UserList();

利用可能なメソッド

$ul->filterByUserName($username)

Filters a list by username.

$ul->filterByKeywords($keywords)

Filters a list by keywords, which searches

  1. Username
  2. Email
  3. Any user attributes marked as being included in the search index.

$ul->filterByGroup($groupName)

Filters by Group name.

$ul->filterByGroupID($groupID)

Only shows users in a particular group (by ID.)

$ul->filterByDateAdded($date, $comparison = '=')

Filters by date. Allows all MySQL comparison symbols (greather than, less than, etc...)

$ul->filterByIsActive($active)

Filters by $active users (1 or 0.)

$ul->filterByAttribute($attributeKeyHandle, $value, $comparison = '=')

Filters by a user attribute key handle. Additionally, the UserList class has a magic method which will allow all user attribute key sorting based on handle

	$ul->filterByDateOfBirth('1979-07-11', '=');
	$ul->filterByGender('male');

$users = $ul->get($itemsToGet = 100, $offset = 0)

Gets all users who fit the criteria.

$users->getPage($page = false)

Gets a page of users (taking into account $itemsPerPage, current page, etc...)


原文:User Search/Filtering