UserCollection
in package
implements
UserCollectionInterface
Class UserCollection
Table of Contents
Interfaces
Properties
- $className : string
Methods
- __construct() : mixed
- UserCollection constructor.
- count() : int
- delete() : bool
- Remove user account.
- find() : UserInterface
- Find a user by username, email, etc
- load() : UserInterface
- Load user account.
- filterUsername() : string
Properties
$className
private
string
$className
Methods
__construct()
UserCollection constructor.
public
__construct(string $className) : mixed
Parameters
- $className : string
count()
public
count() : int
Return values
intdelete()
Remove user account.
public
delete(string $username) : bool
Parameters
- $username : string
Return values
bool —True if the action was performed
find()
Find a user by username, email, etc
public
find(string $query[, array<string|int, mixed> $fields = ['username', 'email'] ]) : UserInterface
Parameters
- $query : string
-
the query to search for
- $fields : array<string|int, mixed> = ['username', 'email']
-
the fields to search
Return values
UserInterfaceload()
Load user account.
public
load(string $username) : UserInterface
Always creates user object. To check if user exists, use $this->exists().
Parameters
- $username : string
Return values
UserInterfacefilterUsername()
protected
filterUsername(string $username) : string
Parameters
- $username : string