forked from coreshop/CoreShop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CoreBundle] implement name functions and add migration for order-nam…
…e and wishlist-name
- Loading branch information
1 parent
71dfc40
commit bc1b311
Showing
8 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
67 changes: 67 additions & 0 deletions
67
src/CoreShop/Bundle/CoreBundle/Migrations/Version20240920110320.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,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CoreShop\Bundle\CoreBundle\Migrations; | ||
|
||
use CoreShop\Component\Pimcore\DataObject\ClassUpdate; | ||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
use Symfony\Component\DependencyInjection\ContainerAwareTrait; | ||
|
||
final class Version20240920110320 extends AbstractMigration implements ContainerAwareInterface | ||
{ | ||
use ContainerAwareTrait; | ||
|
||
public function getDescription(): string | ||
{ | ||
return ''; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$classUpdater = new ClassUpdate( | ||
$this->container->getParameter('coreshop.model.order.pimcore_class_name'), | ||
); | ||
|
||
if ($classUpdater->hasField('name')) { | ||
return; | ||
} | ||
|
||
$nameField = [ | ||
"name" => "name", | ||
"title" => "coreshop.order.name", | ||
"tooltip" => "", | ||
"mandatory" => false, | ||
"noteditable" => true, | ||
"index" => false, | ||
"locked" => false, | ||
"style" => "", | ||
"permissions" => null, | ||
"fieldtype" => "input", | ||
"relationType" => false, | ||
"invisible" => false, | ||
"visibleGridView" => false, | ||
"visibleSearch" => false, | ||
"defaultValue" => null, | ||
"columnLength" => 190, | ||
"regex" => "", | ||
"regexFlags" => [], | ||
"unique" => false, | ||
"showCharCount" => false, | ||
"width" => "", | ||
"defaultValueGenerator" => "", | ||
"datatype" => "data", | ||
]; | ||
|
||
$classUpdater->insertFieldBefore('orderNumber', $nameField); | ||
$classUpdater->save(); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
|
||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
src/CoreShop/Bundle/CoreBundle/Migrations/Version20240920110705.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,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CoreShop\Bundle\CoreBundle\Migrations; | ||
|
||
use CoreShop\Component\Pimcore\DataObject\ClassUpdate; | ||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
use Symfony\Component\DependencyInjection\ContainerAwareTrait; | ||
|
||
final class Version20240920110705 extends AbstractMigration implements ContainerAwareInterface | ||
{ | ||
use ContainerAwareTrait; | ||
|
||
public function getDescription(): string | ||
{ | ||
return ''; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$classUpdater = new ClassUpdate( | ||
$this->container->getParameter('coreshop.model.wishlist.pimcore_class_name'), | ||
); | ||
|
||
if ($classUpdater->hasField('name')) { | ||
return; | ||
} | ||
|
||
$nameField = [ | ||
"name" => "name", | ||
"title" => "coreshop.wishlist.name", | ||
"tooltip" => "", | ||
"mandatory" => false, | ||
"noteditable" => true, | ||
"index" => false, | ||
"locked" => false, | ||
"style" => "", | ||
"permissions" => null, | ||
"fieldtype" => "input", | ||
"relationType" => false, | ||
"invisible" => false, | ||
"visibleGridView" => false, | ||
"visibleSearch" => false, | ||
"defaultValue" => null, | ||
"columnLength" => 190, | ||
"regex" => "", | ||
"regexFlags" => [], | ||
"unique" => false, | ||
"showCharCount" => false, | ||
"width" => "", | ||
"defaultValueGenerator" => "", | ||
"datatype" => "data", | ||
]; | ||
|
||
$classUpdater->insertFieldBefore('token', $nameField); | ||
$classUpdater->save(); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// 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
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
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