<?php

namespace ModulesGarden\HostingQuotaNotifications\App\Configuration\Addon\Activate;

use ModulesGarden\HostingQuotaNotifications\App\Libs\Migration\Migration;
/**
 * Description of After
 *
 * @author Rafał Ossowski <rafal.os@modulesgarden.com>
 */
class After extends \ModulesGarden\HostingQuotaNotifications\Core\Configuration\Addon\Activate\After
{
    /**
     * @return array
     */
    public function execute(array $params = [])
    {
        $return = parent::execute($params);

        if ($return['status'] === 'error')
        {
            \logModuleCall('hosting_quota_notification', 'activate module error', [], var_export($return, true));
            return $return;
        }
        $this->migrate();
        return $return;
    }

    public function migrate()
    {
        $migration = new Migration();
        $migration->run();
    }
}
