DeliveryModuleInterface
interface DeliveryModuleInterface implements BaseModuleInterface
Methods
This method is called when the plugin is installed for the first time
This method is called when a newer version of the plugin is installed
This method is called just before the deletion of the module, giving the module an opportunity to delete its data.
This method is called before the module activation, and may prevent it by returning false.
This method is called just after the module was successfully activated.
This method is called before the module de-activation, and may prevent it by returning false.
This method is called just after the module was successfully deactivated.
Sets a module titles for various languages
Get a module's configuration variable
Set module configuration variable, creating it if required
Ensure the proper deployment of the module's images.
Create or update module hooks returned by the getHooks
function
This method is called by the Delivery loop, to check if the current module has to be displayed to the customer.
Calculate and return delivery price in the shop's default currency
This method return true if your delivery manages virtual product delivery.
Details
in
BaseModuleInterface at line 25
install(
ConnectionInterface $con = null)
This method is called when the plugin is installed for the first time
in
BaseModuleInterface at line 34
update(
string $currentVersion,
string $newVersion,
ConnectionInterface $con = null)
This method is called when a newer version of the plugin is installed
in
BaseModuleInterface at line 44
destroy(
ConnectionInterface $con = null,
bool $deleteModuleData = false)
This method is called just before the deletion of the module, giving the module an opportunity to delete its data.
in
BaseModuleInterface at line 51
activate(
Module $moduleModel = null)
This method is called when the module is activated
in
BaseModuleInterface at line 58
deActivate(
Module $moduleModel = null)
This method is called when the module is deactivated
in
BaseModuleInterface at line 68
bool
preActivation(
ConnectionInterface $con = null)
This method is called before the module activation, and may prevent it by returning false.
in
BaseModuleInterface at line 75
postActivation(
ConnectionInterface $con = null)
This method is called just after the module was successfully activated.
in
BaseModuleInterface at line 83
bool
preDeactivation(
ConnectionInterface $con = null)
This method is called before the module de-activation, and may prevent it by returning false.
in
BaseModuleInterface at line 90
postDeactivation(
ConnectionInterface $con = null)
This method is called just after the module was successfully deactivated.
in
BaseModuleInterface at line 99
setTitle(
Module $module,
array $titles)
Sets a module titles for various languages
in
BaseModuleInterface at line 109
static
string
getConfigValue(
string $variableName,
string $defaultValue = null,
null $valueLocale = null)
Get a module's configuration variable
in
BaseModuleInterface at line 121
static
$this;
setConfigValue(
string $variableName,
string $variableValue,
null $valueLocale = null,
bool $createIfNotExists = true)
Set module configuration variable, creating it if required
in
BaseModuleInterface at line 141
deployImageFolder(
Module $module,
string $folderPath,
ConnectionInterface $con = null)
Ensure the proper deployment of the module's images.
TODO : this method does not take care of internationalization. This is a bug.
in
BaseModuleInterface at line 147
Module
getModuleModel()
in
BaseModuleInterface at line 152
static
string
getModuleId()
in
BaseModuleInterface at line 157
static
string
getModuleCode()
in
BaseModuleInterface at line 162
string
getCode()
in
BaseModuleInterface at line 200
static
getCompilers()
This method adds new compilers to Thelia container
You must return an array. This array can contain : - arrays - one or many instance(s) of \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
in the first case, your array must contains 2 indexes. The first is the compiler instance and the second the compilerPass type. Example : return array( array( new \MyModule\DependencyInjection\Compiler\MySuperCompilerPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPEBEFOREOPTIMIZATION ) );
In the seconde case, just an instance of CompilerPassInterface. Example : return array ( new \MyModule\DependencyInjection\Compiler\MySuperCompilerPass() );
But you can combine both behaviors Example :
return array( new \MyModule\DependencyInjection\Compiler\MySuperCompilerPass(), array( new \MyModule\DependencyInjection\Compiler\MyOtherSuperCompilerPass(), Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPEBEFOREOPTIMIZATION ) );
in
BaseModuleInterface at line 244
array
getHooks()
in
BaseModuleInterface at line 249
registerHooks()
Create or update module hooks returned by the getHooks
function
at line 32
boolean
isValidDelivery(
Country $country)
This method is called by the Delivery loop, to check if the current module has to be displayed to the customer.
Override it to implements your delivery rules/
If you return true, the delivery method will de displayed to the customer If you return false, the delivery method will not be displayed
at line 42
OrderPostage|float
getPostage(
Country $country)
Calculate and return delivery price in the shop's default currency
at line 50
bool
handleVirtualProductDelivery()
This method return true if your delivery manages virtual product delivery.