Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created March 13, 2017 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/5d98a761bee251ded81a389f5d212413 to your computer and use it in GitHub Desktop.
Save kurozumi/5d98a761bee251ded81a389f5d212413 to your computer and use it in GitHub Desktop.
【EC-CUBE3】プラグインを有効化したときにdtb_page_layoutにページ情報を登録
<?php
/*
* This file is part of the SamplePlugin
*
* Copyright (C) 2017 サンプルプラグイン
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\SamplePlugin;
use Eccube\Application;
use Eccube\Plugin\AbstractPluginManager;
class PluginManager extends AbstractPluginManager
{
/**
* プラグインインストール時の処理
*
* @param $config
* @param Application $app
* @throws \Exception
*/
public function install($config, Application $app)
{
}
/**
* プラグイン削除時の処理
*
* @param $config
* @param Application $app
*/
public function uninstall($config, Application $app)
{
$this->migrationSchema($app, __DIR__.'/Resource/doctrine/migration', $config['code'], 0);
}
/**
* プラグイン有効時の処理
*
* @param $config
* @param Application $app
* @throws \Exception
*/
public function enable($config, Application $app)
{
$this->migrationSchema($app, __DIR__.'/Resource/doctrine/migration', $config['code']);
}
/**
* プラグイン無効時の処理
*
* @param $config
* @param Application $app
* @throws \Exception
*/
public function disable($config, Application $app)
{
}
/**
* プラグイン更新時の処理
*
* @param $config
* @param Application $app
* @throws \Exception
*/
public function update($config, Application $app)
{
$this->migrationSchema($app, __DIR__.'/Resource/doctrine/migration', $config['code']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment