PHP Class WordPress\ORM\Model\User

Author: Brandon Wamboldt ([email protected])
Inheritance: extends WordPress\ORM\BaseModel
Show file Open project: brandonwamboldt/wp-orm

Protected Properties

Property Type Description
$ID integer
$display_name string
$meta array
$user_activation_key string
$user_email string
$user_login string
$user_nicename string
$user_pass string
$user_registered DateTime
$user_status string
$user_url string

Public Methods

Method Description
__construct ( array $properties = [] ) Override the default constructor so we can type cast certain properties.
delete_metadata ( string $meta_key ) Delete the user's meta data.
flatten_props ( array $props ) : array Convert complex objects to strings to insert into the database.
get_metadata ( string $meta_key, mixed $default = null ) : mixed Get the user's meta data.
get_primary_key ( ) : string Get the model's primary key.
get_searchable_fields ( ) : array Get an array of properties to search when doing a search query.
get_table ( ) : string Get the table used to store posts.
update_metadata ( string $meta_key, mixed $meta_value ) Update the user's meta data.

Method Details

__construct() public method

Override the default constructor so we can type cast certain properties.
public __construct ( array $properties = [] )
$properties array

delete_metadata() public method

Delete the user's meta data.
public delete_metadata ( string $meta_key )
$meta_key string

flatten_props() public method

Convert complex objects to strings to insert into the database.
public flatten_props ( array $props ) : array
$props array
return array

get_metadata() public method

Get the user's meta data.
public get_metadata ( string $meta_key, mixed $default = null ) : mixed
$meta_key string
$default mixed
return mixed

get_primary_key() public static method

Get the model's primary key.
public static get_primary_key ( ) : string
return string

get_searchable_fields() public static method

Get an array of properties to search when doing a search query.
public static get_searchable_fields ( ) : array
return array

get_table() public static method

Get the table used to store posts.
public static get_table ( ) : string
return string

update_metadata() public method

Update the user's meta data.
public update_metadata ( string $meta_key, mixed $meta_value )
$meta_key string
$meta_value mixed

Property Details

$ID protected property

protected int $ID
return integer

$display_name protected property

protected string $display_name
return string

$meta protected property

protected array $meta
return array

$user_activation_key protected property

protected string $user_activation_key
return string

$user_email protected property

protected string $user_email
return string

$user_login protected property

protected string $user_login
return string

$user_nicename protected property

protected string $user_nicename
return string

$user_pass protected property

protected string $user_pass
return string

$user_registered protected property

protected DateTime $user_registered
return DateTime

$user_status protected property

protected string $user_status
return string

$user_url protected property

protected string $user_url
return string