Class UserData
User Data is a base model for objects typically submitted by the end-user of the application.
-
Charcoal\Model\AbstractModel
-
Charcoal\Object\UserData
implements
Charcoal\Object\UserDataInterface
Methods summary
public
Charcoal\Object\UserDataInterface
|
#
setIp( integer|null $ip )
Set the client IP address.
Set the client IP address.
Parameters
- $ip
- The remote IP at object creation.
Returns
Implementation of
|
public
integer|null
|
#
ip( )
Retrieve the client IP address.
Retrieve the client IP address.
Returns
integer|null
Implementation of
|
public
Charcoal\Object\UserDataInterface
|
#
setLang( string $lang )
Set the origin language.
Parameters
Returns
Throws
InvalidArgumentException If the argument is not a string.
Implementation of
|
public
string
|
#
lang( )
Retrieve the language.
Returns
string
Implementation of
|
public
Charcoal\Object\UserDataInterface
|
#
setOrigin( string $origin )
Set the origin of the object submission.
Set the origin of the object submission.
Parameters
- $origin
- The source URL or identifier of the submission.
Returns
Throws
InvalidArgumentException If the argument is not a string.
Implementation of
|
public
string
|
#
resolveOrigin( )
Resolve the origin of the user data.
Resolve the origin of the user data.
Returns
string
|
public
string
|
#
origin( )
Retrieve the origin of the object submission.
Retrieve the origin of the object submission.
Returns
string
Implementation of
|
public
Charcoal\Object\UserDataInterface
|
#
setTs( DateTime|string|null $timestamp )
Set when the object was created.
Set when the object was created.
Parameters
- $timestamp
The timestamp at object's creation.
NULL is accepted and instances of DateTimeInterface are recommended;
any other value will be converted (if possible) into one.
Returns
Throws
InvalidArgumentException If the timestamp is invalid.
Implementation of
|
public
DateTime|null
|
#
ts( )
Retrieve the creation timestamp.
Retrieve the creation timestamp.
Returns
DateTime|null
Implementation of
|
public
boolean
|
#
preSave( )
Event called before creating the object.
Event called before creating the object.
Returns
boolean
See
Charcoal\Source\StorableTrait::preSave() For the "create" Event.
|