PHP Class MC4WP_Integration_Manager

Show file Open project: dannyvankooten/mailchimp-for-wordpress Class Usage Examples

Protected Properties

Property Type Description
$integrations MC4WP_Integration_Fixture[]
$options array
$tags MC4WP_Integration_Tags

Public Methods

Method Description
__construct ( ) Constructor
add_hooks ( ) Add hooks
deregister_integration ( string $slug ) Deregister an integration class
get ( string $slug ) : MC4WP_Integration Get an integration instance
get_all ( ) : MC4WP_Integration_Fixture[] Get an integration instance
get_enabled_integrations ( ) : array Get the integrations which are enabled
get_integration_options ( $slug ) : array Get the raw options for an integration
get_options ( ) : array
initialize ( ) Add hooks
is_enabled ( MC4WP_Integration_Fixture $integration ) : boolean Checks whether a certain integration is enabled (in the settings)
is_installed ( MC4WP_Integration $integration ) : boolean
register_integration ( string $slug, string $class, boolean $enabled = false ) Register a new integration class

Method Details

__construct() public method

Constructor
public __construct ( )

add_hooks() public method

Add hooks
public add_hooks ( )

deregister_integration() public method

Deregister an integration class
public deregister_integration ( string $slug )
$slug string

get() public method

Get an integration instance
public get ( string $slug ) : MC4WP_Integration
$slug string
return MC4WP_Integration

get_all() public method

Get an integration instance
public get_all ( ) : MC4WP_Integration_Fixture[]
return MC4WP_Integration_Fixture[]

get_enabled_integrations() public method

- Some integrations are always enabled because they need manual work - Other integrations can be enabled in the settings page - Only returns installed integrations
public get_enabled_integrations ( ) : array
return array

get_integration_options() public method

Get the raw options for an integration
public get_integration_options ( $slug ) : array
$slug
return array

get_options() public method

public get_options ( ) : array
return array

initialize() public method

Add hooks
public initialize ( )

is_enabled() public method

This is decoupled from the integration class itself as checking an array is way "cheaper" than instantiating an object
public is_enabled ( MC4WP_Integration_Fixture $integration ) : boolean
$integration MC4WP_Integration_Fixture
return boolean

is_installed() public method

public is_installed ( MC4WP_Integration $integration ) : boolean
$integration MC4WP_Integration
return boolean

register_integration() public method

Register a new integration class
public register_integration ( string $slug, string $class, boolean $enabled = false )
$slug string
$class string
$enabled boolean

Property Details

$integrations protected property

protected MC4WP_Integration_Fixture[] $integrations
return MC4WP_Integration_Fixture[]

$options protected property

protected array $options
return array

$tags protected property

protected MC4WP_Integration_Tags $tags
return MC4WP_Integration_Tags