Initial Commit
This commit is contained in:
40
local/modules/Slide/Slide.php
Normal file
40
local/modules/Slide/Slide.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Slide;
|
||||
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Slide\Model\SlideItemQuery;
|
||||
use Thelia\Install\Database;
|
||||
use Thelia\Module\BaseModule;
|
||||
|
||||
class Slide extends BaseModule
|
||||
{
|
||||
public function preActivation(ConnectionInterface $con = null)
|
||||
{
|
||||
$injectSql = false;
|
||||
|
||||
try {
|
||||
$item = SlideItemQuery::create()->findOne();
|
||||
} catch (\Exception $ex) {
|
||||
// the table doest not exist
|
||||
$injectSql = true;
|
||||
}
|
||||
|
||||
if (true === $injectSql) {
|
||||
$database = new Database($con);
|
||||
$database->insertSql(null, array(__DIR__ . '/Config/thelia.sql'));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user