Skip to content

Commit

Permalink
[CoreBundle] make onHold field readonly. fixes #372
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfaffenbauer committed Mar 22, 2018
1 parent a9651ef commit 8507358
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
@@ -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)
{

}
}
Expand Up @@ -508,7 +508,7 @@
"title": "On Hold",
"tooltip": "",
"mandatory": false,
"noteditable": false,
"noteditable": true,
"index": false,
"locked": false,
"style": "",
Expand Down

0 comments on commit 8507358

Please sign in to comment.