Skip to content

Commit

Permalink
[CoreBundle] only re-save classes with StorePrice or ProductSpecificP…
Browse files Browse the repository at this point in the history
…riceRule
  • Loading branch information
dpfaffenbauer committed Jul 19, 2018
1 parent 5bc69e7 commit 7d5df2f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace CoreShop\Bundle\CoreBundle\Migrations;

use CoreShop\Bundle\CoreBundle\CoreExtension\StorePrice;
use CoreShop\Bundle\ProductBundle\CoreExtension\ProductSpecificPriceRules;
use Doctrine\DBAL\Schema\Schema;
use Pimcore\Migrations\Migration\AbstractPimcoreMigration;
use Pimcore\Model\DataObject\ClassDefinition;
Expand All @@ -21,7 +23,12 @@ public function up(Schema $schema)
$classes = $classes->load();

foreach ($classes as $class) {
$class->save();
foreach ($class->getFieldDefinitions() as $definition) {
if ($definition instanceof StorePrice || $definition instanceof ProductSpecificPriceRules) {
$class->save();
break;
}
}
}

}
Expand Down

0 comments on commit 7d5df2f

Please sign in to comment.