-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #536 from coreshop/lazy-loading-core-extensions
[CoreBundle, ProductBundle] Lazy Loading Core Extensions
- Loading branch information
Showing
4 changed files
with
145 additions
and
17 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
44 changes: 44 additions & 0 deletions
44
src/CoreShop/Bundle/CoreBundle/Migrations/Version20180719151524.php
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,44 @@ | ||
<?php | ||
|
||
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; | ||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
use Symfony\Component\DependencyInjection\ContainerAwareTrait; | ||
|
||
class Version20180719151524 extends AbstractPimcoreMigration implements ContainerAwareInterface | ||
{ | ||
use ContainerAwareTrait; | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$classes = new ClassDefinition\Listing(); | ||
$classes = $classes->load(); | ||
|
||
foreach ($classes as $class) { | ||
foreach ($class->getFieldDefinitions() as $definition) { | ||
if ($definition instanceof StorePrice || $definition instanceof ProductSpecificPriceRules) { | ||
$class->save(); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
|
||
} | ||
} |
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