Methods summary
public
string
|
|
public
Charcoal\User\AuthToken
|
|
public
string
|
|
public
Charcoal\User\AuthToken
|
|
public
string
|
|
public
User
|
#
setUsername( string $username )
Force a lowercase username
Force a lowercase username
Parameters
- $username
- The username (also the login name).
Returns
User Chainable
Throws
InvalidArgumentException If the username is not a string.
|
public
string
|
|
public
Content
|
#
setExpiry( DateTime|string|null $expiry )
Parameters
- $expiry
- The date/time at object's creation.
Returns
Content Chainable
Throws
InvalidArgumentException If the date/time is invalid.
|
public
DateTimeInterface|null
|
#
expiry( )
Returns
DateTimeInterface|null
|
public
Content
|
#
setCreated( DateTime|string|null $created )
Parameters
- $created
- The date/time at object's creation.
Returns
Content Chainable
Throws
InvalidArgumentException If the date/time is invalid.
|
public
DateTime|null
|
|
public
Content
|
#
setLastModified( DateTime|string|null $lastModified )
Parameters
- $lastModified
- The last modified date/time.
Returns
Content Chainable
Throws
InvalidArgumentException If the date/time is invalid.
|
public
DateTime
|
|
public
Charcoal\User\AuthToken
|
#
generate( string $username )
Note: the random_bytes() function is new to PHP-7. Available in PHP 5 with compat-random .
Note: the random_bytes() function is new to PHP-7. Available in PHP 5 with compat-random .
Parameters
- $username
- The username to generate the auth token from.
Returns
|
public
Charcoal\User\AuthToken
|
|
public
boolean
|
#
preSave( )
StorableTrait > preSave(): Called automatically before saving the object to source.
StorableTrait > preSave(): Called automatically before saving the object to source.
Returns
boolean
|
public
boolean
|
#
preUpdate( array $properties = null )
StorableTrait > preUpdate(): Called automatically before updating the object to source.
StorableTrait > preUpdate(): Called automatically before updating the object to source.
Parameters
- $properties
- The properties (ident) set for update.
Returns
boolean
|
public
array
|
|
public
mixed
|
#
getUserId( mixed $ident, string $token )
Parameters
- $ident
- The auth-token identifier.
- $token
- The token key to validate against.
Returns
mixed The user id.
|
public
mixed
|
#
getUsernameFromToken( mixed $ident, string $token )
Parameters
- $ident
- The auth-token identifier (username).
- $token
- The token to validate against.
Returns
mixed The user id. An empty string if no token match.
|
protected
|
#
panic( )
Something is seriously wrong: a cookie ident was in the database but with a tampered token.
Something is seriously wrong: a cookie ident was in the database but with a tampered token.
|
protected
MetadataInterface
|
#
createMetadata( array $data = null )
DescribableTrait > create_metadata().
DescribableTrait > create_metadata().
Parameters
- $data
- Optional data to intialize the Metadata object with.
Returns
MetadataInterface
|