class Producer extends Base implements IProducer

Base class for the producer class.

Constants

FEATURES_KEY

Properties

protected string $_name
protected $_classes from Base
protected IImporter $_importer
protected array $_importer_data
protected array $_features
protected IGroup $_active_group
protected array $_groups
protected array $_methods
protected array $_parameters
protected string $_methods_cmp_str
protected string $_parameters_cmp_str
protected Manager $_manager

Methods

string
getName()

Returns the name.

from Base
boolean
setName(string $name)

Sets the name.

from Base
array
getClasses()

Returns all declared classes.

from Base
__construct(Manager $manager = null)

Creates the producer instance.

parse()

No description

setManager(Manager $manager)

Sets the manager.

getManager()

Returns the manager.

array
getGroups()

Returns the groups.

array
getFeatures()

Returns the features.

array
getMethods()

Returns the methods that the producer should look for.

import(IImporter $importer)

Starts the importing process.

export(IExporter $exporter)

Starts the exporting process.

transform(IImporter $from, IExporter $to)

Will do the import and export in one call.

Feature
addFeature(string $name, array $methods)

Adds a feature to the producer.

addGroup(string $name, array $value)

Adds a group to the producer.

createMethod(string $method, array $params)

Adds a method to the producer that will be assigned to a feature.

Details

in Base at line 30
final string getName()

Returns the name.

Return Value

string

in Base at line 41
final boolean setName(string $name)

Sets the name.

Parameters

string $name

Return Value

boolean

in Base at line 57
array getClasses()

Returns all declared classes.

We need this way, because the autoloader will try to include the class file if we use "class_exists" or similar functions.

Return Value

array

at line 90
__construct(Manager $manager = null)

Creates the producer instance.

Parameters

Manager $manager Our manager as reference back.

at line 96
abstract protected parse()

at line 103
setManager(Manager $manager)

Sets the manager.

Parameters

Manager $manager

at line 113
getManager()

Returns the manager.

at line 123
array getGroups()

Returns the groups.

Return Value

array of \jtl\Connector\Feature\Group\IGroup

at line 133
array getFeatures()

Returns the features.

Return Value

array of \jtl\Connector\Feature\Feature\IFeature

at line 143
array getMethods()

Returns the methods that the producer should look for.

Return Value

array of string

at line 158
import(IImporter $importer)

Starts the importing process.

Parameters

IImporter $importer

See also

self::parse()

at line 174
export(IExporter $exporter)

Starts the exporting process.

Parameters

IExporter $exporter The exporter object, that implements the IExporter interface to be conform to this manager/producer.

See also

$exporter->load()

at line 192
transform(IImporter $from, IExporter $to)

Will do the import and export in one call.

Parameters

IImporter $from
IExporter $to

at line 205
protected Feature addFeature(string $name, array $methods)

Adds a feature to the producer.

Parameters

string $name The name of the new feature.
array $methods An array with the

Return Value

Feature

at line 222
protected IGroup addGroup(string $name, array $value)

Adds a group to the producer.

Parameters

string $name The name of th new group.
array $value The params for the new group.

Return Value

IGroup

at line 244
protected IMethod createMethod(string $method, array $params)

Adds a method to the producer that will be assigned to a feature.

Parameters

string $method The name of the new method.
array $params The params array for the new method.

Return Value

IMethod

Exceptions

ExceptionProducer If the setter for a parameter doesn't exists in the method class, we need to inform the caller about the inconsistency.