forked from thelia-modules/CustomerScope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomerScope.php
37 lines (33 loc) · 858 Bytes
/
CustomerScope.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace CustomerScope;
use CustomerScope\Model\CustomerScopeQuery;
use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Install\Database;
use Thelia\Module\BaseModule;
/**
* Class CustomerScope
* @package CustomerScope
*/
class CustomerScope extends BaseModule
{
/**
* Translation Message Domain
*/
const MESSAGE_DOMAIN = 'customerscope';
/**
* {@inheritdoc}
* - Insert the module's DB model
*/
public function postActivation(ConnectionInterface $con = null)
{
/**
* Create the module tables if they do not exists
*/
$database = new Database($con);
try {
CustomerScopeQuery::create()->findOne();
} catch (\Exception $e) {
$database->insertSql(null, [__DIR__ . DS . 'Config' . DS . 'thelia.sql']);
}
}
}