EventProcedures

Events

EventProceduresTriggered

plentymarkets event procedures triggered

Namespace

Plenty\Modules\EventProcedures\Events

Methods

public getTicket():Ticket

Gets the ticket.

public getOrder():Order

Gets the order

Services

EventProceduresService

The EventProcedureService class offers the possibility to register a procedure class and method that can be called by plentymarkets event procedures.

Namespace

Plenty\Modules\EventProcedures\Services

Methods

public registerProcedure(string $moduleName, string $eventType, array $procedureNames, string $procedureClass, string $procedureGroup = \Plenty\Modules\EventProcedures\Services\Entries\ProcedureEntry::PROCEDURE_GROUP_ORDER):bool

Register a procedure class

Parameters
string $moduleName The name of the module. The name of the module can be choosen freely.
string $eventType The name of the event type. The event types are determined and can be one of the following:
  • {@see \ProcedureEntry::EVENT_TYPE_ORDER},
  • {@see \ProcedureEntry::EVENT_TYPE_REORDER} or
  • {@see \ProcedureEntry::EVENT_TYPE_TICKET}
array $procedureNames The name for the procedure that will be shown in the event procedure UI. The name is unique and will be used for German and English.
string $procedureClass The fully qualified name of the procedure class to be called by event procedures. Each procedure class must either contain the execute method defined by plentymarkets or can contain an individual method. The individual method has to be provided along with procedure class. The method is separated from the class by an "@" sign. The part following the "@" will be interpreted as method name. The part in front of the "@" is the name of the procedure class.
string $procedureGroup The name of the procedure group. The procedure groups are determined and can be one of the following:
  • {@see \ProcedureEntry::PROCEDURE_GROUP_ORDER},
  • {@see \ProcedureEntry::PROCEDURE_GROUP_ITEM},
  • {@see \ProcedureEntry::PROCEDURE_GROUP_DOCUMENT},
  • {@see \ProcedureEntry::PROCEDURE_GROUP_CONTACT},
  • {@see \ProcedureEntry::PROCEDURE_GROUP_SHIPPING},
  • {@see \ProcedureEntry::PROCEDURE_GROUP_PAYMENT},
  • {@see \ProcedureEntry::PROCEDURE_GROUP_RETURN} or
  • {@see \ProcedureEntry::PROCEDURE_GROUP_LISTING}
  • [optional, default={@see \ProcedureEntry::PROCEDURE_GROUP_ORDER}]
public registerFilter(string $moduleName, string $eventType, array $filterNames, string $filterClass):bool

Register a filter class

Parameters
string $moduleName The name of the module. The name of the module can be choosen freely.
string $eventType The name of the event type. The event types are determined and can be one of the following:
  • order
  • ticket
array $filterNames The name for the filter that will be shown in the event procedure UI. The name is unique and will be used for German and English.
string $filterClass The fully qualified name of the filter class to be called by event procedures. Each procedure class must either contain the accept method defined by plentymarkets or can contain an individual method. The individual method has to be provided along with procedure class. The method is separated from the class by an "@" sign. The part following the "@" will be interpreted as method name. The part in front of the "@" is the name of the procedure class. The method must return a boolean.
public registerTrigger(string $moduleName, string $eventType, string $triggerIdentifier, array $triggerNames):bool

Register a trigger

Parameters
string $moduleName The name of the module. The name of the module can be choosen freely.
string $eventType The name of the event type. The event types are determined and can be one of the following:
  • order
string $triggerIdentifier The identifier for the trigger that will be used to identify the trigger on fire. The identifier of the trigger can be choosen freely.
array $triggerNames The name for the trigger that will be shown in the event procedure UI. The name is unique and will be used for German and English.
public fireTrigger(int $orderId, string $moduleName, string $triggerIdentifier):void

Fire a trigger

Parameters
int $orderId The id of the order for which the trigger is fired.
string $moduleName The name of the module. The name of the module given on register the trigger.
string $triggerIdentifier The identifier for the trigger given on register the trigger.

Services

Entries

FilterEntry

The filter entry contains all information needed to use module filters in plentymarkets event procedures.

Namespace

Plenty\Modules\EventProcedures\Services\Entries

Methods

public getModuleName():string

Gets the module name.

public setModuleName(string $moduleName):FilterEntry

Sets the module name

Parameters
string $moduleName
public getEventType():string

Gets the type of event for the current filter entry.

public setEventType(string $eventType):FilterEntry

Sets the event type

Parameters
string $eventType
public getFilterNames():array

Gets the filter names

public setFilterNames(array $filterNames):FilterEntry

Sets the filter names

Parameters
array $filterNames
public getFilterClass():string

Gets the filter class

public setFilterClass(string $filterClass):FilterEntry

Sets the filter class

Parameters
string $filterClass

ProcedureEntry

The procedure entry contains all information needed to use module procedures in plentymarkets event procedures.

Namespace

Plenty\Modules\EventProcedures\Services\Entries

Methods

public getModuleName():string

Gets the module name

public setModuleName(string $moduleName):ProcedureEntry

Sets the module name

Parameters
string $moduleName
public getEventType():string

Gets the event type

public setEventType(string $eventType):ProcedureEntry

Sets the event type

Parameters
string $eventType
public getProcedureNames():array

Gets the procedure names

public setProcedureNames(array $procedureNames):ProcedureEntry

Sets the procedure names

Parameters
array $procedureNames
public getProcedureGroup():string

Gets the procedure group

public setProcedureGroup(string $procedureGroup):ProcedureEntry

Sets the procedure group

Parameters
string $procedureGroup
public getProcedureClass():string

Gets the procedure class

public setProcedureClass(string $procedureClass):ProcedureEntry

Sets the procedure class

Parameters
string $procedureClass

TriggerEntry

The trigger entry contains all information needed to use module triggers in plentymarkets event procedures.

Namespace

Plenty\Modules\EventProcedures\Services\Entries

Methods

public getModuleName():string

Gets the module name

public setModuleName(string $moduleName):TriggerEntry

Sets the module name

Parameters
string $moduleName
public getEventType():string

Gets the event type

public setEventType(string $eventType):TriggerEntry

Sets the event type

Parameters
string $eventType
public getTriggerIdentifier():string

Gets the trigger identifier

public setTriggerIdentifier(string $triggerIdentifier):TriggerEntry

Sets the trigger identifier

Parameters
string $triggerIdentifier
public getTriggerNames():array

Gets the trigger names

public setTriggerNames(array $triggerNames):TriggerEntry

Sets the trigger names

Parameters
array $triggerNames
public getTrigger():int

Gets the trigger