-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added controller to apply changes to database
- Loading branch information
Showing
2 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Swissup\Core\Controller\Adminhtml\Theme; | ||
|
||
use Magento\Framework\Controller\ResultFactory; | ||
|
||
class FixAll extends \Magento\Backend\App\Action | ||
{ | ||
const ADMIN_RESOURCE = 'Swissup_Core::theme_fixall'; | ||
|
||
public function execute() | ||
{ | ||
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON); | ||
$resultJson->setData(['message' => 'Virtual themes fixed. Please, clear the cache!']); | ||
|
||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | ||
|
||
$connection = $objectManager->create('\Magento\Framework\App\ResourceConnection')->getConnection(); | ||
$tableName = $connection->getTableName('theme'); | ||
$connection->update($tableName, ['type' => 0]); | ||
|
||
return $resultJson; | ||
} | ||
} |
f1201c6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify your commit as it didn't pass some tests