class BaseModule implements BaseModuleInterface

Traits

Symfony\Component\DependencyInjection\ContainerAwareTrait

Constants

CLASSIC_MODULE_TYPE

DELIVERY_MODULE_TYPE

PAYMENT_MODULE_TYPE

MODULE_CATEGORIES

IS_ACTIVATED

IS_NOT_ACTIVATED

Methods

activate( Module $moduleModel = null)

This method is called when the module is activated

deActivate( Module $moduleModel = null)

This method is called when the module is deactivated

hasContainer()

No description

getContainer()

No description

hasRequest()

No description

setRequest( Request $request)

No description

getRequest()

No description

hasDispatcher()

No description

setDispatcher( EventDispatcherInterface $dispatcher)

No description

EventDispatcherInterface
getDispatcher()

No description

setTitle( Module $module, array $titles)

No description

static  string
getConfigValue( string $variableName, string $defaultValue = null, null $valueLocale = null)

No description

static  $this;
setConfigValue( string $variableName, string $variableValue, null $valueLocale = null, bool $createIfNotExists = true)

No description

deployImageFolder( Module $module, string $folderPath, ConnectionInterface $con = null)

No description

getModuleModel()

No description

static  string
getModuleId()

No description

static  string
getModuleCode()

No description

string
getCode()

No description

bool
isPaymentModuleFor( Order $order)

Check if this module is the payment module for a given order

bool
isDeliveryModuleFor( Order $order)

Check if this module is the delivery module for a given order

float|int
getCurrentOrderTotalAmount( bool $with_tax = true, bool $with_discount = true, bool $with_postage = true)

A convenient method to get the current order total, with or without tax, discount or postage.

static 
getCompilers()

No description

install( ConnectionInterface $con = null)

No description

update( string $currentVersion, string $newVersion, ConnectionInterface $con = null)

No description

bool
preActivation( ConnectionInterface $con = null)

No description

postActivation( ConnectionInterface $con = null)

No description

bool
preDeactivation( ConnectionInterface $con = null)

No description

postDeactivation( ConnectionInterface $con = null)

No description

destroy( ConnectionInterface $con = null, bool $deleteModuleData = false)

No description

array
getHooks()

No description

registerHooks()

No description

Details

at line 66
activate( Module $moduleModel = null)

This method is called when the module is activated

Parameters

Module $moduleModel the module

at line 92
deActivate( Module $moduleModel = null)

This method is called when the module is deactivated

Parameters

Module $moduleModel the module

at line 115
hasContainer()

at line 120
getContainer()

at line 129
hasRequest()

at line 134
setRequest( Request $request)

Parameters

Request $request

at line 144
Request getRequest()

Return Value

Request the request.

Exceptions

RuntimeException

at line 158
hasDispatcher()

at line 163
setDispatcher( EventDispatcherInterface $dispatcher)

Parameters

EventDispatcherInterface $dispatcher

at line 172
EventDispatcherInterface getDispatcher()

Return Value

EventDispatcherInterface

Exceptions

RuntimeException

at line 189
setTitle( Module $module, array $titles)

Parameters

Module $module the module.
array $titles an associative array of locale => title_string

at line 216
static string getConfigValue( string $variableName, string $defaultValue = null, null $valueLocale = null)

Parameters

string $variableName the variable name
string $defaultValue the default value, if variable is not defined
null $valueLocale the required locale, or null to get default one

Return Value

string the variable value

at line 225
static $this; setConfigValue( string $variableName, string $variableValue, null $valueLocale = null, bool $createIfNotExists = true)

Parameters

string $variableName the variable name
string $variableValue the variable value
null $valueLocale the locale, or null if not required
bool $createIfNotExists if true, the variable will be created if not already defined

Return Value

$this;

at line 234
deployImageFolder( Module $module, string $folderPath, ConnectionInterface $con = null)

Parameters

Module $module the module
string $folderPath the image folder path
ConnectionInterface $con

at line 313
Module getModuleModel()

Return Value

Module

at line 341
static string getModuleId()

Return Value

string The module id

at line 362
static string getModuleCode()

Return Value

string The module code, in a static way

at line 372
string getCode()

Return Value

string The module code

at line 383
bool isPaymentModuleFor( Order $order)

Check if this module is the payment module for a given order

Parameters

Order $order an order

Return Value

bool true if this module is the payment module for the given order.

at line 396
bool isDeliveryModuleFor( Order $order)

Check if this module is the delivery module for a given order

Parameters

Order $order an order

Return Value

bool true if this module is the delivery module for the given order.

at line 415
float|int getCurrentOrderTotalAmount( bool $with_tax = true, bool $with_discount = true, bool $with_postage = true)

A convenient method to get the current order total, with or without tax, discount or postage.

This method operates on the order currently in the user's session, and should not be used to get the total amount of an order already stored in the database. For such orders, use Order::getTotalAmount() method.

Parameters

bool $with_tax if true, to total price will include tax amount
bool $with_discount if true, the total price will include discount, if any
bool $with_postage if true, the total price will include the delivery costs, if any.

Return Value

float|int the current order amount.

at line 448
static getCompilers()

at line 456
install( ConnectionInterface $con = null)

Parameters

ConnectionInterface $con

at line 464
update( string $currentVersion, string $newVersion, ConnectionInterface $con = null)

Parameters

string $currentVersion the current (installed) module version, as defined in the module.xml file
string $newVersion the new module version, as defined in the module.xml file
ConnectionInterface $con

at line 472
bool preActivation( ConnectionInterface $con = null)

Parameters

ConnectionInterface $con

Return Value

bool true to continue module activation, false to prevent it.

at line 481
postActivation( ConnectionInterface $con = null)

Parameters

ConnectionInterface $con

at line 489
bool preDeactivation( ConnectionInterface $con = null)

Parameters

ConnectionInterface $con

Return Value

bool true to continue module de-activation, false to prevent it.

at line 498
postDeactivation( ConnectionInterface $con = null)

Parameters

ConnectionInterface $con

at line 506
destroy( ConnectionInterface $con = null, bool $deleteModuleData = false)

Parameters

ConnectionInterface $con
bool $deleteModuleData if true, the module should remove all its data from the system.

at line 514
array getHooks()

Return Value

array This method must be used when your module defines hooks. Override this and return an array of your hooks names to register them

This returned value must be like the example, only type and code are mandatory

Example:

return array(

 // Only register the title in the default language
 array(
     "type" => TemplateDefinition::BACK_OFFICE,
     "code" => "my_super_hook_name",
     "title" => "My hook",
     "description" => "My hook is really, really great",
 ),

 // Manage i18n
 array(
     "type" => TemplateDefinition::FRONT_OFFICE,
     "code" => "my_hook_name",
     "title" => array(
         "fr_FR" => "Mon Hook",
         "en_US" => "My hook",
     ),
     "description" => array(
         "fr_FR" => "Mon hook est vraiment super",
         "en_US" => "My hook is really, really great",
     ),
     "chapo" => array(
         "fr_FR" => "Mon hook est vraiment super",
         "en_US" => "My hook is really, really great",
     ),
     "block" => true,
     "active" => true
 )

);

at line 522
registerHooks()