-
-
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.
[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
bc1b311
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you now, like Pimcore, also lock the PRs after they have been merged (why actually?), I can't comment on that there, but...
did you commit the (empty) file
Dockerfile-franken
by mistake?bc1b311
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from the CLA Workflow. I configured it the same as pimcore did, time will tell if that is good.
The Franken Dockerfile is by accident, I will remove it again
bc1b311
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the idea die the locking:
„It is highly recommended to lock the Pull Request after merging so that the Contributors won't be able to revoke their signature comments after merge“