PHP Class Papi_Porter_Driver, papi

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

Protected Properties

Property Type Description
$alias array | string Alias for driver name.
$name string The driver name.
$options array Options per property.
$porter Papi_Porter Papi Porter instance.

Public Methods

Method Description
__construct ( ) The constructor.
bootstrap ( ) Bootstrap the driver.
filter ( string $type, string $filter ) : string Get filter key.
get_driver_name ( ) : string Get the driver name.
get_options ( ) : array Get options.
get_value ( array $options ) : mixed Get the import value for a property.
set_options ( array $options = [] ) Set options for properties.
set_porter ( Papi_Porter $porter ) Set Porter instance.

Protected Methods

Method Description
call_value ( mixed $value ) : mixed Call closure value if any.
set_driver_alias ( ) Set driver alias.
set_driver_name ( string $name ) Set driver name.
should_update_array ( string $slug ) : boolean Determine if a property should update existing array or not.
with ( mixed $obj ) : mixed Return the given object. Useful for chaining.

Method Details

__construct() public method

The constructor.
public __construct ( )

bootstrap() public method

Bootstrap the driver.
public bootstrap ( )

call_value() protected method

Call closure value if any.
protected call_value ( mixed $value ) : mixed
$value mixed
return mixed

filter() public method

Get filter key.
public filter ( string $type, string $filter ) : string
$type string
$filter string
return string

get_driver_name() public method

Get the driver name.
public get_driver_name ( ) : string
return string

get_options() public method

Get options.
public get_options ( ) : array
return array

get_value() abstract public method

Get the import value for a property.
abstract public get_value ( array $options ) : mixed
$options array
return mixed

set_driver_alias() protected method

Set driver alias.
protected set_driver_alias ( )

set_driver_name() protected method

Set driver name.
protected set_driver_name ( string $name )
$name string

set_options() public method

Set options for properties.
public set_options ( array $options = [] )
$options array

set_porter() public method

Set Porter instance.
public set_porter ( Papi_Porter $porter )
$porter Papi_Porter

should_update_array() protected method

Determine if a property should update existing array or not.
protected should_update_array ( string $slug ) : boolean
$slug string
return boolean

with() protected method

Return the given object. Useful for chaining.
protected with ( mixed $obj ) : mixed
$obj mixed
return mixed

Property Details

$alias protected property

Alias for driver name.
protected array|string $alias
return array | string

$name protected property

The driver name.
protected string $name
return string

$options protected property

Options per property.
protected array $options
return array

$porter protected property

Papi Porter instance.
protected Papi_Porter $porter
return Papi_Porter