PHP Class Papi_Core_Meta_Store, papi

Show file Open project: wp-papi/papi Class Usage Examples

Public Properties

Property Type Description
$id integer The WordPress meta id if it exists.

Protected Properties

Property Type Description
$meta_values array Properties meta values.
$properties array Current properties.
$type string The meta type.
$type_class Papi_Core_Type The type class.

Public Methods

Method Description
factory ( integer $post_id, string $type = 'post' ) : mixed Get store from factory.
format_value ( string $slug, mixed $value ) : mixed Format property value from the property.
get_property ( string $slug, string $child_slug = '' ) : Papi_Core_Property Get property from entry type.
get_property_meta_value ( string $slug ) : mixed Get property meta value.
get_property_option ( string $slug, string $option, mixed $default = null ) : boolean Get property option or default value.
get_type ( ) : string Get meta type.
get_type_class ( ) : Papi_Core_Type Get type class.
get_value ( integer $id = null, string $slug = null, mixed $default = null, string $type = 'post' ) : mixed Get value.
load_value ( string $slug ) : mixed Load property value from the property.
set_property_meta_value ( string $slug, mixed $value ) Set property meta value.
valid ( ) : boolean Check if it's a valid store.

Protected Methods

Method Description
prepare_load_value ( Papi_Core_Property $property, mixed $value ) : mixed Prepare load value.
prepare_property ( Papi_Core_Property $property ) : Papi_Core_Property Prepare property before returning it.
property ( string $slug = '' ) : Papi_Core_Property Get current property.

Method Details

factory() public static method

Get store from factory.
public static factory ( integer $post_id, string $type = 'post' ) : mixed
$post_id integer
$type string
return mixed

format_value() public method

Format property value from the property.
public format_value ( string $slug, mixed $value ) : mixed
$slug string
$value mixed
return mixed

get_property() abstract public method

Get property from entry type.
abstract public get_property ( string $slug, string $child_slug = '' ) : Papi_Core_Property
$slug string
$child_slug string
return Papi_Core_Property

get_property_meta_value() public method

Get property meta value.
public get_property_meta_value ( string $slug ) : mixed
$slug string
return mixed

get_property_option() public method

Get property option or default value.
public get_property_option ( string $slug, string $option, mixed $default = null ) : boolean
$slug string
$option string
$default mixed
return boolean

get_type() public method

Get meta type.
public get_type ( ) : string
return string

get_type_class() public method

Get type class.
public get_type_class ( ) : Papi_Core_Type
return Papi_Core_Type

get_value() public method

Get value.
public get_value ( integer $id = null, string $slug = null, mixed $default = null, string $type = 'post' ) : mixed
$id integer
$slug string
$default mixed
$type string
return mixed

load_value() public method

Load property value from the property.
public load_value ( string $slug ) : mixed
$slug string
return mixed

prepare_load_value() protected method

Prepare load value.
protected prepare_load_value ( Papi_Core_Property $property, mixed $value ) : mixed
$property Papi_Core_Property
$value mixed
return mixed

prepare_property() protected method

Prepare property before returning it.
protected prepare_property ( Papi_Core_Property $property ) : Papi_Core_Property
$property Papi_Core_Property
return Papi_Core_Property

property() protected method

Get current property.
protected property ( string $slug = '' ) : Papi_Core_Property
$slug string
return Papi_Core_Property

set_property_meta_value() public method

Set property meta value.
public set_property_meta_value ( string $slug, mixed $value )
$slug string
$value mixed

valid() abstract public method

Check if it's a valid store.
abstract public valid ( ) : boolean
return boolean

Property Details

$id public property

The WordPress meta id if it exists.
public int $id
return integer

$meta_values protected property

Properties meta values.
protected array $meta_values
return array

$properties protected property

Current properties.
protected array $properties
return array

$type protected property

The meta type.
protected string $type
return string

$type_class protected property

The type class.
protected Papi_Core_Type $type_class
return Papi_Core_Type