/**
  * Remove data.
  *
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     if (Version::isSupportGetInstanceFunction()) {
         $app = Application::getInstance();
         $meta = $this->getMetadata($app['orm.em']);
         $tool = new SchemaTool($app['orm.em']);
         $schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
         // テーブル削除
         foreach ($schemaFromMetadata->getTables() as $table) {
             if ($schema->hasTable($table->getName())) {
                 $schema->dropTable($table->getName());
             }
         }
         // シーケンス削除
         foreach ($schemaFromMetadata->getSequences() as $sequence) {
             if ($schema->hasSequence($sequence->getName())) {
                 $schema->dropSequence($sequence->getName());
             }
         }
     } else {
         // this down() migration is auto-generated, please modify it to your needs
         $schema->dropTable(self::NAME);
     }
 }
Exemplo n.º 2
0
 /**
  * onAdminProductCategoryEditAfter.
  *
  * for v3.0.0 - 3.0.8
  *
  * @deprecated for since v3.0.0, to be removed in 3.1
  */
 public function onAdminProductCategoryEditAfter()
 {
     if (Version::isSupportNewHookPoint()) {
         return;
     }
     $this->app['eccube.plugin.categorycontent.event_legacy']->onAdminProductCategoryEditAfter();
 }
Exemplo n.º 3
0
<?php

/*
 * This file is part of the Recommend Product plugin
 *
 * Copyright (C) 2016 LOCKON CO.,LTD. All Rights Reserved.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Plugin\CategoryContent\Util\Version;
if (Version::isSupportLogFunction()) {
    return;
}
if (function_exists('log_emergency') === false) {
    /**
     * Log emergency.
     * Urgent alert. System is unusable.
     *
     * @param string $message
     * @param array  $context
     */
    function log_emergency($message, array $context = array())
    {
        if (isset($GLOBALS['eccube_logger'])) {
            $GLOBALS['eccube_logger']->emergency($message, $context);
        }
    }
}
if (function_exists('log_alert') === false) {
    /**