Property | Type | Description | |
---|---|---|---|
$data | array | Mapping data | |
$site | integer | Site ID |
Method | Description | |
---|---|---|
__clone ( ) | Clone magic method when clone( self ) is called. | |
create ( string $site, string $domain, boolean $active = false ) : |
Create a new domain mapping | |
delete ( ) : boolean | WP_Erro\WP_Error | Delete the mapping | |
get ( integer | |
Get mapping by mapping ID | |
get_by_domain ( string | array $domains ) : |
Get mapping by domain(s) | |
get_by_site ( integer | stdClass $site ) : |
Get mapping by site ID | |
get_domain ( ) : string | Get the domain from the mapping | |
get_id ( ) : integer | Get mapping ID | |
get_site ( ) : stdClass | boolean | Get site object | |
get_site_id ( ) : integer | Get site ID | |
is_active ( ) : boolean | Is the mapping active? | |
make_primary ( ) : boolean | WP_Error | Make this mapping the primary domain, eg. set the homeurl for the site | |
set_active ( boolean $active ) : boolean | WP_Erro\WP_Error | Set whether the mapping is active | |
set_domain ( string $domain ) : boolean | WP_Erro\WP_Error | Set the domain for the mapping | |
update ( array | stdClass $data ) : boolean | WP_Erro\WP_Error | Update the mapping |
Method | Description | |
---|---|---|
__construct ( array $data ) | Constructor | |
to_instance ( stdClass $data ) : |
Convert data to Mapping instance | |
to_instances ( stdClass[] $data ) : |
Convert list of data to Mapping instances |
public __clone ( ) |
protected __construct ( array $data ) | ||
$data | array | Mapping data |
public static get_by_site ( integer | stdClass $site ) : |
||
$site | integer | stdClass | Site ID, or site object from {@see \get_blog_details} |
return | Mapping on success, WP_Error if error occurred, or null if no mapping found |
public get_domain ( ) : string | ||
return | string |
public make_primary ( ) : boolean | WP_Error | ||
return | boolean | WP_Error | True if we created the old mapping or WP_Error if an error occurred |
public set_active ( boolean $active ) : boolean | WP_Erro\WP_Error | ||
$active | boolean | Should the mapping be active? (True for active, false for inactive) |
return | boolean | WP_Erro\WP_Error | True if we updated, false if we didn't need to, or WP_Error if an error occurred |
public set_domain ( string $domain ) : boolean | WP_Erro\WP_Error | ||
$domain | string | Domain name |
return | boolean | WP_Erro\WP_Error | True if we updated, false if we didn't need to, or WP_Error if an error occurred |
protected static to_instance ( stdClass $data ) : |
||
$data | stdClass | Raw mapping data |
return |
protected static to_instances ( stdClass[] $data ) : |
||
$data | stdClass[] | Raw mapping rows |
return |