/** * 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; }
public function deteleAll() { $users = $this->userManager->findUsers(); foreach ($users as $user) { $this->userManager->deleteUser($user); } }
/** * 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; }
/** * @inheritdoc */ public function all($limit = null, $offset = null) { return $this->FOSUserManager->findUsers(); }