PHP Class Papi_Porter, papi

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

Protected Properties

Property Type Description
$driver Papi_Porter_Driver The driver that should be used.

Public Methods

Method Description
__construct ( ) The constructor.
add_driver ( Papi_Porter_Driver $driver ) : Papi_Porter Add Porter Driver.
after ( string $filter, Closure $closure, integer $priority = 10, integer $accepted_args = 2 ) : boolean Add after filter.
before ( string $filter, Closure $closure, integer $priority = 10, integer $accepted_args = 2 ) : boolean Add before filter.
driver ( string | Papi_Porter_Driver $driver ) : Papi_Porter Alias for add_driver or use_driver method.
driver_exists ( string $driver ) : boolean Check if a driver exists or not.
export ( mixed $post_id, boolean $only_values = false ) : array Export data from Papi. With or without all property options.
fire_filter ( array $options ) : mixed Fire filter.
import ( mixed $options, array $fields = [] ) : boolean Import data to Papi.
options ( array $options = [] ) : Papi_Porter Add options per property.
use_driver ( string $driver ) : Papi_Porter Change Porter driver.

Protected Methods

Method Description
get_import_options ( mixed $options ) : array Get import options.
get_value ( array $options ) : mixed Get value that should be saved.

Method Details

__construct() public method

The constructor.
public __construct ( )

add_driver() public method

Add Porter Driver.
public add_driver ( Papi_Porter_Driver $driver ) : Papi_Porter
$driver Papi_Porter_Driver
return Papi_Porter

after() public method

Add after filter.
public after ( string $filter, Closure $closure, integer $priority = 10, integer $accepted_args = 2 ) : boolean
$filter string
$closure Closure
$priority integer
$accepted_args integer
return boolean

before() public method

Add before filter.
public before ( string $filter, Closure $closure, integer $priority = 10, integer $accepted_args = 2 ) : boolean
$filter string
$closure Closure
$priority integer
$accepted_args integer
return boolean

driver() public method

Alias for add_driver or use_driver method.
public driver ( string | Papi_Porter_Driver $driver ) : Papi_Porter
$driver string | Papi_Porter_Driver
return Papi_Porter

driver_exists() public method

Check if a driver exists or not.
public driver_exists ( string $driver ) : boolean
$driver string
return boolean

export() public method

Export data from Papi. With or without all property options.
public export ( mixed $post_id, boolean $only_values = false ) : array
$post_id mixed
$only_values boolean
return array

fire_filter() public method

Fire filter.
public fire_filter ( array $options ) : mixed
$options array
return mixed

get_import_options() protected method

Get import options.
protected get_import_options ( mixed $options ) : array
$options mixed
return array

get_value() protected method

Get value that should be saved.
protected get_value ( array $options ) : mixed
$options array
return mixed

import() public method

Import data to Papi.
public import ( mixed $options, array $fields = [] ) : boolean
$options mixed
$fields array
return boolean

options() public method

Add options per property.
public options ( array $options = [] ) : Papi_Porter
$options array
return Papi_Porter

use_driver() public method

Change Porter driver.
public use_driver ( string $driver ) : Papi_Porter
$driver string
return Papi_Porter

Property Details

$driver protected property

The driver that should be used.
protected Papi_Porter_Driver $driver
return Papi_Porter_Driver