class Manager extends Base

Manager class for the feature parser of the famous JTL connector.

Properties

protected string $_name from Base
protected $_classes from Base
protected array $_methods
protected array $_parameters
protected Producer $_producer

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(Producer $producer = null)

Constructor.

setProducer(Producer $producer)

Sets the producer, the base class of this converting manager.

Producer
getProducer()

Returns the Producer.

array
getParameters()

Returns the parameters that will be extraced during the import/export.

registerParameter(string $name)

Registers a parameter where the producer will looking for during the import/export phase.

registerParameters(array $parameters)

Registers multiple parameters.

bool
existsParameter(string $name)

Checks if a parameter already exists and returns the result as boolean.

array
getMethods()

Returns the methods that will be extraced during the import/export.

registerMethod(string $name)

Registers a method by name where the producer will look for during the import/export phase.

registerMethods(array $methods)

Registers multiple methods at once.

bool
existsMethod(string $name)

Checks if a method already exists and returns the result as boolean.

checkProducer(string $type = 'Import')

Will check if the producer exists.

array
import(IImporter $importer)

Starts the importing process in the producer.

mixed
export(IExporter $export)

Starts the exporting process in the producer.

mixed
transform(IImporter $from, IExporter $to)

Will do the import and export in one call.

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 46
__construct(Producer $producer = null)

Constructor.

Parameters

Producer $producer The base class instance that is required to import and export our feature.

at line 60
setProducer(Producer $producer)

Sets the producer, the base class of this converting manager.

Parameters

Producer $producer

at line 71
Producer getProducer()

Returns the Producer.

Return Value

Producer

at line 81
array getParameters()

Returns the parameters that will be extraced during the import/export.

Return Value

array Standard key value array.

at line 94
registerParameter(string $name)

Registers a parameter where the producer will looking for during the import/export phase.

Parameters

string $name The name of the needed parameter.

Exceptions

Manager If the parameter is already added, we need to notify the caller of his inconsistency.

at line 108
registerParameters(array $parameters)

Registers multiple parameters.

Parameters

array $parameters Standard key value array.

See also

self::registerParameter()

at line 121
protected bool existsParameter(string $name)

Checks if a parameter already exists and returns the result as boolean.

Parameters

string $name The parameter name.

Return Value

bool If the parameter already exists TRUE, otherwhise FALSE.

at line 131
array getMethods()

Returns the methods that will be extraced during the import/export.

Return Value

array

at line 144
registerMethod(string $name)

Registers a method by name where the producer will look for during the import/export phase.

Parameters

string $name The name of the method.

Exceptions

Manager If the method is already added we need to notify the caller about his inconsistency.

at line 158
registerMethods(array $methods)

Registers multiple methods at once.

Parameters

array $methods Standard key/value array.

See also

self::registerMethod()

at line 171
protected bool existsMethod(string $name)

Checks if a method already exists and returns the result as boolean.

Parameters

string $name The parameter name.

Return Value

bool If the parameter already exists TRUE, otherwhise FALSE.

at line 186
protected checkProducer(string $type = 'Import')

Will check if the producer exists.

If there is no producer, we need to inform the caller about his inconsistency.

Parameters

string $type The type of process, this should usually be 'Import' or 'Export'.

Exceptions

Manager If there is no producer, we need to inform the caller about his inconsistency.

at line 202
array import(IImporter $importer)

Starts the importing process in the producer.

Parameters

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

Return Value

array The imported feature array.

at line 217
mixed export(IExporter $export)

Starts the exporting process in the producer.

Parameters

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

Return Value

mixed The result of the export call may be various.

at line 234
mixed transform(IImporter $from, IExporter $to)

Will do the import and export in one call.

Parameters

IImporter $from The Importer object, that implements the IImporter interface to be conform to this manager/producer.
IExporter $to The Exporter object, that implements the IExporter interface to be conform to this manager/producer.

Return Value

mixed The result of the transform call may be various.