本文整理匯總了PHP中UserList::filterByFirstName方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserList::filterByFirstName方法的具體用法?PHP UserList::filterByFirstName怎麽用?PHP UserList::filterByFirstName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserList
的用法示例。
在下文中一共展示了UserList::filterByFirstName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getLeaders
public function getLeaders($searchString, $city, $limit)
{
Loader::model('user_list');
$av = Loader::helper('concrete/avatar');
$ul = new UserList();
$ul->filterByKeywords($searchString);
$ul->filterByGroup('Walk Leaders');
$ul->filterByIsActive(1);
$ul->filterByFirstName(null, '!=');
$ul->filterByFirstName('', '!=');
$ul->filter('uLastLogin', 0, '!=');
$ul->sortBy('uLastLogin');
$userSet = [];
foreach ($ul->get($limit ?: 5) as $user) {
$home_city = $user->getAttribute('home_city');
$userSet[$user->getUserID()] = ['user_id' => $user->getUserID(), 'first_name' => $user->getAttribute('first_name'), 'last_name' => $user->getAttribute('last_name'), 'city_name' => $home_city ? $home_city->getCollectionName() : null, 'city_id' => $home_city ? $home_city->getCollectionID() : null, 'bio' => $user->getAttribute('bio'), 'twitter' => $user->getAttribute('twitter'), 'facebook' => $user->getAttribute('facebook'), 'website' => $user->getAttribute('website'), 'avatar' => $av->getImagePath($user)];
}
return json_encode($userSet);
}