本文整理汇总了PHP中FOS\UserBundle\Model\UserManagerInterface::findUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManagerInterface::findUsers方法的具体用法?PHP UserManagerInterface::findUsers怎么用?PHP UserManagerInterface::findUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOS\UserBundle\Model\UserManagerInterface
的用法示例。
在下文中一共展示了UserManagerInterface::findUsers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCollection
/**
* Returns all users in a single collection resource.
*
* @param string[] $options
*
* @return Resource
*/
public function getCollection(array $options = array())
{
/** @var UserEntity[] $collection */
$collection = $this->userManager->findUsers();
$resource = new Resource($this->generateBrowseUrl(), array('count' => count($collection)));
foreach ($collection as $element) {
$resource->setEmbedded('user', $this->createResourceFromUser($element));
}
return $resource;
}
示例2: deteleAll
public function deteleAll()
{
$users = $this->userManager->findUsers();
foreach ($users as $user) {
$this->userManager->deleteUser($user);
}
}
示例3: getPrincipalsByPrefix
/**
* Returns a list of principals based on a prefix.
*
* This prefix will often contain something like 'principals'. You are only
* expected to return principals that are in this base path.
*
* You are expected to return at least a 'uri' for every user, you can
* return any additional properties if you wish so. Common properties are:
* {DAV:}displayname
* {http://sabredav.org/ns}email-address - This is a custom SabreDAV
* field that's actually injected in a number of other properties. If
* you have an email address, use this property.
*
* @param string $prefixPath
*
* @return array
*/
public function getPrincipalsByPrefix($prefixPath)
{
$userlist = $this->user_manager->findUsers();
$principals = array();
foreach ($userlist as $user) {
// due to the lack of the implementation of prefixes, return all users
$principals[] = $this->getPrincipalArray($user);
}
return $principals;
}
示例4: all
/**
* @inheritdoc
*/
public function all($limit = null, $offset = null)
{
return $this->FOSUserManager->findUsers();
}