Last active
May 2, 2019 11:08
-
-
Save KristianH/02b1d1b3262d9b138b49 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
//WARNING: this file deletes content from DB! be careful! | |
// Use this in a oxid e-sales shop 4.7.0 or higher | |
//if you are aware of the risks, remove or comment the next line: | |
die('Please read the comments!'); | |
include('bootstrap.php'); | |
$aDeletes = array( | |
'oxcategory', | |
'oxvendor', | |
'oxmanufacturer', | |
'oxattribute', | |
'oxarticle', | |
'oxselectlist', | |
); | |
foreach ($aDeletes AS $class) { | |
/** @var oxBase $oEntity */ | |
$oEntity = oxNew($class); | |
$aOxIds = oxDB::getDb(oxDb::FETCH_MODE_ASSOC)->getAll("SELECT oxid FROM {$oEntity->getCoreTableName()}"); | |
foreach ($aOxIds as $sId) { | |
$oEntity->delete($sId['oxid']); | |
} | |
echo $oEntity->getClassName() . ': ' . count($aOxIds) . PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, pull requests are not available for gist...
I would like you to review and merge the changes i have made in my fork of this gist.