Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CoreBundle] make onHold field readonly. fixes #372
- Loading branch information
1 parent
a9651ef
commit 8507358
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/CoreShop/Bundle/CoreBundle/Migrations/Version20180322162638.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,37 @@ | ||
<?php | ||
|
||
namespace CoreShop\Bundle\CoreBundle\Migrations; | ||
|
||
use CoreShop\Component\Pimcore\ClassUpdate; | ||
use Doctrine\DBAL\Schema\Schema; | ||
use Pimcore\Migrations\Migration\AbstractPimcoreMigration; | ||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
use Symfony\Component\DependencyInjection\ContainerAwareTrait; | ||
|
||
class Version20180322162638 extends AbstractPimcoreMigration implements ContainerAwareInterface | ||
{ | ||
use ContainerAwareTrait; | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$cartClass = $this->container->getParameter('coreshop.model.product.pimcore_class_name'); | ||
|
||
$classUpdater = new ClassUpdate($cartClass); | ||
|
||
if ($classUpdater->hasField('onHold')) { | ||
$classUpdater->replaceFieldProperties('onHold', ['noteditable' => true]); | ||
$classUpdater->save(); | ||
} | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
|
||
} | ||
} |
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