diff --git a/src/Entity/Lengow/Action/ActionEntity.php b/src/Entity/Lengow/Action/ActionEntity.php index 1402491..61e6948 100644 --- a/src/Entity/Lengow/Action/ActionEntity.php +++ b/src/Entity/Lengow/Action/ActionEntity.php @@ -52,14 +52,14 @@ class ActionEntity extends Entity protected $state; /** - * @var DateTimeInterface|null + * @var \DateTimeInterface|null */ - protected $createdAt; + protected ?\DateTimeInterface $createdAt = null; /** - * @var DateTimeInterface|null + * @var \DateTimeInterface|null */ - protected $updatedAt; + protected ?\DateTimeInterface $updatedAt = null; /** * @return ShopwareOrderEntity diff --git a/src/Entity/Lengow/Order/OrderEntity.php b/src/Entity/Lengow/Order/OrderEntity.php index 4eb835d..a94f0a2 100644 --- a/src/Entity/Lengow/Order/OrderEntity.php +++ b/src/Entity/Lengow/Order/OrderEntity.php @@ -163,14 +163,14 @@ class OrderEntity extends Entity protected $message; /** - * @var DateTimeInterface|null + * @var \DateTimeInterface|null */ - protected $createdAt; + protected ?\DateTimeInterface $createdAt = null; /** - * @var DateTimeInterface|null + * @var \DateTimeInterface|null */ - protected $updatedAt; + protected ?\DateTimeInterface $updatedAt = null; /** * @var DateTimeInterface|null diff --git a/src/Entity/Lengow/OrderError/OrderErrorEntity.php b/src/Entity/Lengow/OrderError/OrderErrorEntity.php index 79a238e..31bc10f 100644 --- a/src/Entity/Lengow/OrderError/OrderErrorEntity.php +++ b/src/Entity/Lengow/OrderError/OrderErrorEntity.php @@ -42,14 +42,14 @@ class OrderErrorEntity extends Entity protected $mail; /** - * @var DateTimeInterface|null + * @var \DateTimeInterface|null */ - protected $createdAt; + protected ?\DateTimeInterface $createdAt = null; /** - * @var DateTimeInterface|null + * @var \DateTimeInterface|null */ - protected $updatedAt; + protected ?\DateTimeInterface $updatedAt = null; /** * @return LengowOrderEntity diff --git a/src/Entity/Lengow/OrderLine/OrderLineEntity.php b/src/Entity/Lengow/OrderLine/OrderLineEntity.php index 1962736..364156e 100644 --- a/src/Entity/Lengow/OrderLine/OrderLineEntity.php +++ b/src/Entity/Lengow/OrderLine/OrderLineEntity.php @@ -33,14 +33,14 @@ class OrderLineEntity extends Entity protected $orderLineId; /** - * @var DateTimeInterface|null + * @var \DateTimeInterface|null */ - protected $createdAt; + protected ?\DateTimeInterface $createdAt = null; /** - * @var DateTimeInterface|null + * @var \DateTimeInterface|null */ - protected $updatedAt; + protected ?\DateTimeInterface $updatedAt = null; /** * @return ShopwareOrderEntity diff --git a/src/Entity/Lengow/Product/ProductEntity.php b/src/Entity/Lengow/Product/ProductEntity.php index f795cde..d66fa74 100644 --- a/src/Entity/Lengow/Product/ProductEntity.php +++ b/src/Entity/Lengow/Product/ProductEntity.php @@ -26,9 +26,9 @@ class ProductEntity extends Entity protected $salesChannel; /** - * @var DateTimeInterface + * @var \DateTimeInterface|null */ - protected $createdAt; + protected ?\DateTimeInterface $createdAt = null; /** * @return string @@ -63,17 +63,17 @@ public function setSalesChannel(ShopwareSalesChannelEntity $salesChannel): void } /** - * @return DateTimeInterface + * @return \DateTimeInterface|null */ - public function getCreatedAt(): DateTimeInterface + public function getCreatedAt(): ?DateTimeInterface { return $this->createdAt; } /** - * @param DateTimeInterface $createdAt + * @param \DateTimeInterface|null $createdAt */ - public function setCreatedAt(DateTimeInterface $createdAt): void + public function setCreatedAt(?DateTimeInterface $createdAt): void { $this->createdAt = $createdAt; } diff --git a/src/Entity/Lengow/Settings/SettingsEntity.php b/src/Entity/Lengow/Settings/SettingsEntity.php index 2984d29..314cad1 100644 --- a/src/Entity/Lengow/Settings/SettingsEntity.php +++ b/src/Entity/Lengow/Settings/SettingsEntity.php @@ -32,14 +32,14 @@ class SettingsEntity extends Entity protected $value; /** - * @var DateTimeInterface + * @var \DateTimeInterface|null */ - protected $createdAt; + protected ?\DateTimeInterface $createdAt = null; /** - * @var DateTimeInterface + * @var \DateTimeInterface|null */ - protected $updatedAt; + protected ?\DateTimeInterface $updatedAt = null; /** * @return ShopwareSalesChannelEntity|null @@ -90,33 +90,33 @@ public function setValue(?string $value): void } /** - * @return DateTimeInterface + * @return \DateTimeInterface|null */ - public function getCreatedAt(): DateTimeInterface + public function getCreatedAt(): ?DateTimeInterface { return $this->createdAt; } /** - * @param DateTimeInterface $createdAt + * @param \DateTimeInterface|null $createdAt */ - public function setCreatedAt(DateTimeInterface $createdAt): void + public function setCreatedAt(?DateTimeInterface $createdAt): void { $this->createdAt = $createdAt; } /** - * @return DateTimeInterface + * @return \DateTimeInterface|null */ - public function getUpdatedAt(): DateTimeInterface + public function getUpdatedAt(): ?DateTimeInterface { return $this->updatedAt; } /** - * @param DateTimeInterface $updatedAt + * @param \DateTimeInterface|null $updatedAt */ - public function setUpdatedAt(DateTimeInterface $updatedAt): void + public function setUpdatedAt(?DateTimeInterface $updatedAt): void { $this->updatedAt = $updatedAt; } diff --git a/src/EntityExtension/Extension/ProductExtension.php b/src/EntityExtension/Extension/ProductExtension.php index 8d86619..ec67e0d 100644 --- a/src/EntityExtension/Extension/ProductExtension.php +++ b/src/EntityExtension/Extension/ProductExtension.php @@ -31,4 +31,12 @@ public function getDefinitionClass(): string { return ProductDefinition::class; } + + /** + * @return string + */ + public function getEntityName(): string + { + return 'product'; + } } \ No newline at end of file diff --git a/src/LengowConnector.php b/src/LengowConnector.php index 5d37428..11ba1d9 100644 --- a/src/LengowConnector.php +++ b/src/LengowConnector.php @@ -70,9 +70,9 @@ public function uninstall(UninstallContext $uninstallContext): void if (!$uninstallContext->keepUserData()) { $connection = $this->container->get(Connection::class); - $connection->executeUpdate('DROP TABLE IF EXISTS `lengow_order`, `lengow_order_line`, `lengow_order_error`, `lengow_action`, `lengow_settings`, `lengow_product`;'); + $connection->executeStatement('DROP TABLE IF EXISTS `lengow_order`, `lengow_order_line`, `lengow_order_error`, `lengow_action`, `lengow_settings`, `lengow_product`;'); - $connection->executeUpdate(' + $connection->executeStatement(' DELETE FROM state_machine_transition WHERE to_state_id = ( SELECT id FROM state_machine_state WHERE technical_name = "lengow_technical_error" @@ -81,7 +81,7 @@ public function uninstall(UninstallContext $uninstallContext): void ); '); - $connection->executeUpdate(' + $connection->executeStatement(' DELETE FROM state_machine_state WHERE technical_name = "lengow_technical_error"; '); @@ -106,6 +106,7 @@ private function addPaymentMethod(Context $context): void // payment handler will be selected by the identifier 'handlerIdentifier' => LengowPayment::class, 'name' => 'Lengow payment', + 'technicalName' => 'lengow_payment', 'description' => 'Lengow payment, DO NOT activate NOR delete', 'pluginId' => $pluginId, 'afterOrderEnabled' => false, diff --git a/src/Migration/Migration1606313662Init.php b/src/Migration/Migration1606313662Init.php index e833daa..7a49156 100644 --- a/src/Migration/Migration1606313662Init.php +++ b/src/Migration/Migration1606313662Init.php @@ -21,7 +21,7 @@ public function update(Connection $connection): void * order (FK order_id) * sales_channel (FK sales_channel_id) */ - $connection->executeUpdate(' + $connection->executeStatement(' CREATE TABLE IF NOT EXISTS `lengow_order` ( `id` BINARY(16) NOT NULL, `order_id` BINARY(16) NULL DEFAULT NULL, @@ -73,7 +73,7 @@ public function update(Connection $connection): void * order (FK order_id) * product (FK product_id) */ - $connection->executeUpdate(' + $connection->executeStatement(' CREATE TABLE IF NOT EXISTS `lengow_order_line` ( `id` BINARY(16) NOT NULL, `order_id` BINARY(16) NOT NULL, @@ -91,7 +91,7 @@ public function update(Connection $connection): void * this table reference another lengow table : * lengow_order (FK lengow_order_id) */ - $connection->executeUpdate(' + $connection->executeStatement(' CREATE TABLE IF NOT EXISTS `lengow_order_error` ( `id` BINARY(16) NOT NULL, `lengow_order_id` BINARY(16) NOT NULL, @@ -111,7 +111,7 @@ public function update(Connection $connection): void * this table reference 1 shopware base table : * order (FK order_id) */ - $connection->executeUpdate(' + $connection->executeStatement(' CREATE TABLE IF NOT EXISTS `lengow_action` ( `id` BINARY(16) NOT NULL, `order_id` BINARY(16) NOT NULL, @@ -133,7 +133,7 @@ public function update(Connection $connection): void * this table reference 1 shopware base table : * sales_channel (FK sales_channel_id) */ - $connection->executeUpdate(' + $connection->executeStatement(' CREATE TABLE IF NOT EXISTS `lengow_settings` ( `id` BINARY(16) NOT NULL, `sales_channel_id` BINARY(16) NULL DEFAULT NULL, @@ -153,7 +153,7 @@ public function update(Connection $connection): void * product (FK product_id) * sales_channel (FK sales_channel_id) */ - $connection->executeUpdate(' + $connection->executeStatement(' CREATE TABLE IF NOT EXISTS `lengow_product` ( `id` BINARY(16) NOT NULL, `product_id` BINARY(16) NOT NULL, @@ -171,7 +171,7 @@ public function update(Connection $connection): void * order state are linked to state_machine (order.state here) */ $StateUuid = Uuid::randomHex(); // Generate new uuid for insert - $connection->executeUpdate(' + $connection->executeStatement(' INSERT IGNORE INTO state_machine_state VALUES ( UNHEX("' . $StateUuid . '"), "lengow_technical_error", @@ -197,7 +197,7 @@ public function update(Connection $connection): void */ $uuid = Uuid::randomHex(); // Generate new uuid for insert $availableStateUuid = Uuid::fromBytesToHex($state['id']); - $connection->executeUpdate(' + $connection->executeStatement(' INSERT IGNORE INTO state_machine_transition VALUES ( UNHEX("' . $uuid . '"), "technical_error", @@ -219,7 +219,7 @@ public function update(Connection $connection): void '); } $uuid = Uuid::randomHex(); // Generate new uuid for insert - $connection->executeUpdate(' + $connection->executeStatement(' INSERT IGNORE INTO state_machine_transition VALUES ( UNHEX("' . $uuid . '"), "cancel_technical_error", @@ -252,7 +252,7 @@ public function update(Connection $connection): void foreach ($languageAvailable as $language) { $languageId = Uuid::fromBytesToHex($language['id']); if ($languageId) { - $connection->executeUpdate(' + $connection->executeStatement(' INSERT IGNORE INTO state_machine_state_translation VALUES ( UNHEX("' . $languageId . '"), ( @@ -272,7 +272,7 @@ public function update(Connection $connection): void public function updateDestructive(Connection $connection): void { - $connection->executeUpdate(' + $connection->executeStatement(' DROP TABLE IF EXISTS `lengow_settings`, `lengow_product`, diff --git a/src/Migration/Migration1624606589Update102.php b/src/Migration/Migration1624606589Update102.php index ce75256..3122447 100644 --- a/src/Migration/Migration1624606589Update102.php +++ b/src/Migration/Migration1624606589Update102.php @@ -15,7 +15,7 @@ public function getCreationTimestamp(): int public function update(Connection $connection): void { // modifying the value field to be able to store JSON data - $connection->executeUpdate('ALTER TABLE `lengow_settings` CHANGE `value` `value` TEXT NULL DEFAULT NULL'); + $connection->executeStatement('ALTER TABLE `lengow_settings` CHANGE `value` `value` TEXT NULL DEFAULT NULL'); } public function updateDestructive(Connection $connection): void diff --git a/src/Resources/app/administration/src/module/lengow-connector/component/lgw-action-button/lgw-action-button.html.twig b/src/Resources/app/administration/src/module/lengow-connector/component/lgw-action-button/lgw-action-button.html.twig index 1ca564e..9d2f0a1 100644 --- a/src/Resources/app/administration/src/module/lengow-connector/component/lgw-action-button/lgw-action-button.html.twig +++ b/src/Resources/app/administration/src/module/lengow-connector/component/lgw-action-button/lgw-action-button.html.twig @@ -1,21 +1,19 @@ {% block lgw_action_button %} - - - +
{% endblock %} \ No newline at end of file diff --git a/src/Resources/app/administration/src/module/lengow-connector/component/lgw-action-label/lgw-action-label.html.twig b/src/Resources/app/administration/src/module/lengow-connector/component/lgw-action-label/lgw-action-label.html.twig index a7b9529..2736973 100644 --- a/src/Resources/app/administration/src/module/lengow-connector/component/lgw-action-label/lgw-action-label.html.twig +++ b/src/Resources/app/administration/src/module/lengow-connector/component/lgw-action-label/lgw-action-label.html.twig @@ -1,10 +1,8 @@ {% block lgw_action_label %} - -