From 2c2ef3f3b918db0018c41370c8c54a742c8b7a03 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 13 Oct 2022 22:26:33 -0400 Subject: [PATCH] All the GPU CRUD updates --- composer.lock | 217 +++++++++++---------- config/services.yaml | 3 + src/Controller/BrandCategoryController.php | 84 ++++++++ src/Entity/Brand.php | 1 + src/Entity/CameraTrait.php | 20 +- src/Entity/Cpu.php | 39 ++++ src/Entity/Gpu.php | 14 +- src/Entity/GpuCore.php | 12 +- src/Enum/CardBusEnum.php | 7 + src/Enum/SlotKeyEnum.php | 77 ++++++++ src/Form/BrandCategoryType.php | 25 +++ src/Form/GpuType.php | 15 +- src/Kernel.php | 20 +- src/Types/AbstractEnumType.php | 44 +++++ src/Types/CardBusEnumType.php | 19 ++ src/Types/SlotKeyEnumType.php | 19 ++ templates/brand_category/edit.html.twig | 30 +++ templates/brand_category/index.html.twig | 45 +++++ templates/brand_category/new.html.twig | 22 +++ templates/brand_category/show.html.twig | 39 ++++ templates/gpu/index.html.twig | 14 +- templates/gpu/show.html.twig | 2 +- templates/header.html.twig | 4 +- 23 files changed, 630 insertions(+), 142 deletions(-) create mode 100644 src/Controller/BrandCategoryController.php create mode 100644 src/Entity/Cpu.php create mode 100644 src/Enum/CardBusEnum.php create mode 100644 src/Enum/SlotKeyEnum.php create mode 100644 src/Form/BrandCategoryType.php create mode 100644 src/Types/AbstractEnumType.php create mode 100644 src/Types/CardBusEnumType.php create mode 100644 src/Types/SlotKeyEnumType.php create mode 100644 templates/brand_category/edit.html.twig create mode 100644 templates/brand_category/index.html.twig create mode 100644 templates/brand_category/new.html.twig create mode 100644 templates/brand_category/show.html.twig diff --git a/composer.lock b/composer.lock index 0268136..708052a 100644 --- a/composer.lock +++ b/composer.lock @@ -317,16 +317,16 @@ }, { "name": "doctrine/common", - "version": "3.4.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "609c3a7b6af49a7b4b13945ca2fdf4af801946af" + "reference": "8b5e5650391f851ed58910b3e3d48a71062eeced" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/609c3a7b6af49a7b4b13945ca2fdf4af801946af", - "reference": "609c3a7b6af49a7b4b13945ca2fdf4af801946af", + "url": "https://api.github.com/repos/doctrine/common/zipball/8b5e5650391f851ed58910b3e3d48a71062eeced", + "reference": "8b5e5650391f851ed58910b3e3d48a71062eeced", "shasum": "" }, "require": { @@ -388,7 +388,7 @@ ], "support": { "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.4.2" + "source": "https://github.com/doctrine/common/tree/3.4.3" }, "funding": [ { @@ -404,7 +404,7 @@ "type": "tidelift" } ], - "time": "2022-09-28T14:20:50+00:00" + "time": "2022-10-09T11:47:59+00:00" }, { "name": "doctrine/dbal", @@ -1198,16 +1198,16 @@ }, { "name": "doctrine/orm", - "version": "2.13.2", + "version": "2.13.3", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "a8b02fd70fa777ca8278b9604fdef75c15c6a12f" + "reference": "e750360bd52b080c4cbaaee1b48b80f7dc873b36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/a8b02fd70fa777ca8278b9604fdef75c15c6a12f", - "reference": "a8b02fd70fa777ca8278b9604fdef75c15c6a12f", + "url": "https://api.github.com/repos/doctrine/orm/zipball/e750360bd52b080c4cbaaee1b48b80f7dc873b36", + "reference": "e750360bd52b080c4cbaaee1b48b80f7dc873b36", "shasum": "" }, "require": { @@ -1292,9 +1292,9 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.13.2" + "source": "https://github.com/doctrine/orm/tree/2.13.3" }, - "time": "2022-09-22T13:36:43+00:00" + "time": "2022-10-07T06:37:17+00:00" }, { "name": "doctrine/persistence", @@ -2287,16 +2287,16 @@ }, { "name": "symfony/console", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "17524a64ebcfab68d237bbed247e9a9917747096" + "reference": "7fa3b9cf17363468795e539231a5c91b02b608fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/17524a64ebcfab68d237bbed247e9a9917747096", - "reference": "17524a64ebcfab68d237bbed247e9a9917747096", + "url": "https://api.github.com/repos/symfony/console/zipball/7fa3b9cf17363468795e539231a5c91b02b608fc", + "reference": "7fa3b9cf17363468795e539231a5c91b02b608fc", "shasum": "" }, "require": { @@ -2363,7 +2363,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.5" + "source": "https://github.com/symfony/console/tree/v6.1.6" }, "funding": [ { @@ -2379,7 +2379,7 @@ "type": "tidelift" } ], - "time": "2022-09-03T14:24:42+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "symfony/dependency-injection", @@ -2537,16 +2537,16 @@ }, { "name": "symfony/doctrine-bridge", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "ca0fdecd106f81d6bd7f123e77b5830c558e1148" + "reference": "5db7ac51c40d03d576b2696a6b55975e53a3dfd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/ca0fdecd106f81d6bd7f123e77b5830c558e1148", - "reference": "ca0fdecd106f81d6bd7f123e77b5830c558e1148", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/5db7ac51c40d03d576b2696a6b55975e53a3dfd5", + "reference": "5db7ac51c40d03d576b2696a6b55975e53a3dfd5", "shasum": "" }, "require": { @@ -2632,7 +2632,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v6.1.5" + "source": "https://github.com/symfony/doctrine-bridge/tree/v6.1.6" }, "funding": [ { @@ -2648,20 +2648,20 @@ "type": "tidelift" } ], - "time": "2022-09-08T09:34:40+00:00" + "time": "2022-10-10T09:34:31+00:00" }, { "name": "symfony/error-handler", - "version": "v6.1.3", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "736e42db3fd586d91820355988698e434e1d8419" + "reference": "49f718e41f1b6f0fd5730895ca5b1c37defd828d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/736e42db3fd586d91820355988698e434e1d8419", - "reference": "736e42db3fd586d91820355988698e434e1d8419", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/49f718e41f1b6f0fd5730895ca5b1c37defd828d", + "reference": "49f718e41f1b6f0fd5730895ca5b1c37defd828d", "shasum": "" }, "require": { @@ -2703,7 +2703,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.1.3" + "source": "https://github.com/symfony/error-handler/tree/v6.1.6" }, "funding": [ { @@ -2719,7 +2719,7 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:42:06+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "symfony/event-dispatcher", @@ -3114,16 +3114,16 @@ }, { "name": "symfony/framework-bundle", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "be33f4a8b58e40c3ad876537ece359af374eb030" + "reference": "b79e5866a8293de00c8436836c2038ec31916ee7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/be33f4a8b58e40c3ad876537ece359af374eb030", - "reference": "be33f4a8b58e40c3ad876537ece359af374eb030", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/b79e5866a8293de00c8436836c2038ec31916ee7", + "reference": "b79e5866a8293de00c8436836c2038ec31916ee7", "shasum": "" }, "require": { @@ -3245,7 +3245,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v6.1.5" + "source": "https://github.com/symfony/framework-bundle/tree/v6.1.6" }, "funding": [ { @@ -3261,20 +3261,20 @@ "type": "tidelift" } ], - "time": "2022-09-29T11:04:32+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "90f5d9726942db69490fe467a3acb5e7154fd555" + "reference": "3ae8e9c57155fc48930493a629da293b32efbde0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/90f5d9726942db69490fe467a3acb5e7154fd555", - "reference": "90f5d9726942db69490fe467a3acb5e7154fd555", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3ae8e9c57155fc48930493a629da293b32efbde0", + "reference": "3ae8e9c57155fc48930493a629da293b32efbde0", "shasum": "" }, "require": { @@ -3320,7 +3320,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.1.5" + "source": "https://github.com/symfony/http-foundation/tree/v6.1.6" }, "funding": [ { @@ -3336,20 +3336,20 @@ "type": "tidelift" } ], - "time": "2022-09-17T07:55:45+00:00" + "time": "2022-10-02T08:30:52+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "bf433ef30c2dfbf1f47449d5dce8be243e8a0012" + "reference": "102f99bf81799e93f61b9a73b2f38b309c587a94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/bf433ef30c2dfbf1f47449d5dce8be243e8a0012", - "reference": "bf433ef30c2dfbf1f47449d5dce8be243e8a0012", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/102f99bf81799e93f61b9a73b2f38b309c587a94", + "reference": "102f99bf81799e93f61b9a73b2f38b309c587a94", "shasum": "" }, "require": { @@ -3430,7 +3430,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.1.5" + "source": "https://github.com/symfony/http-kernel/tree/v6.1.6" }, "funding": [ { @@ -3446,7 +3446,7 @@ "type": "tidelift" } ], - "time": "2022-09-30T08:10:57+00:00" + "time": "2022-10-12T07:48:47+00:00" }, { "name": "symfony/maker-bundle", @@ -4501,16 +4501,16 @@ }, { "name": "symfony/property-info", - "version": "v6.1.3", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "2fc363ed2f2b5d3b231ed0824e066d140d3fd1d8" + "reference": "f28d0db9d2687f81d68d0dc6b2e42817647f5d64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/2fc363ed2f2b5d3b231ed0824e066d140d3fd1d8", - "reference": "2fc363ed2f2b5d3b231ed0824e066d140d3fd1d8", + "url": "https://api.github.com/repos/symfony/property-info/zipball/f28d0db9d2687f81d68d0dc6b2e42817647f5d64", + "reference": "f28d0db9d2687f81d68d0dc6b2e42817647f5d64", "shasum": "" }, "require": { @@ -4570,7 +4570,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.1.3" + "source": "https://github.com/symfony/property-info/tree/v6.1.6" }, "funding": [ { @@ -4586,7 +4586,7 @@ "type": "tidelift" } ], - "time": "2022-07-19T08:34:05+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "symfony/routing", @@ -4678,16 +4678,16 @@ }, { "name": "symfony/security-core", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "ddba1c08f084ac851c41eab99243db7c42ebf189" + "reference": "e42fb611d1a36e6e1e34f8cd715cea108a39cad5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/ddba1c08f084ac851c41eab99243db7c42ebf189", - "reference": "ddba1c08f084ac851c41eab99243db7c42ebf189", + "url": "https://api.github.com/repos/symfony/security-core/zipball/e42fb611d1a36e6e1e34f8cd715cea108a39cad5", + "reference": "e42fb611d1a36e6e1e34f8cd715cea108a39cad5", "shasum": "" }, "require": { @@ -4749,7 +4749,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v6.1.5" + "source": "https://github.com/symfony/security-core/tree/v6.1.6" }, "funding": [ { @@ -4765,7 +4765,7 @@ "type": "tidelift" } ], - "time": "2022-09-17T07:55:45+00:00" + "time": "2022-10-02T08:30:52+00:00" }, { "name": "symfony/security-csrf", @@ -4987,16 +4987,16 @@ }, { "name": "symfony/string", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "17c08b068176996a1d7db8d00ffae3c248267016" + "reference": "7e7e0ff180d4c5a6636eaad57b65092014b61864" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/17c08b068176996a1d7db8d00ffae3c248267016", - "reference": "17c08b068176996a1d7db8d00ffae3c248267016", + "url": "https://api.github.com/repos/symfony/string/zipball/7e7e0ff180d4c5a6636eaad57b65092014b61864", + "reference": "7e7e0ff180d4c5a6636eaad57b65092014b61864", "shasum": "" }, "require": { @@ -5052,7 +5052,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.5" + "source": "https://github.com/symfony/string/tree/v6.1.6" }, "funding": [ { @@ -5068,20 +5068,20 @@ "type": "tidelift" } ], - "time": "2022-09-02T08:05:20+00:00" + "time": "2022-10-10T09:34:31+00:00" }, { "name": "symfony/translation", - "version": "v6.1.4", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "45d0f5bb8df7255651ca91c122fab604e776af03" + "reference": "e6cd330e5a072518f88d65148f3f165541807494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/45d0f5bb8df7255651ca91c122fab604e776af03", - "reference": "45d0f5bb8df7255651ca91c122fab604e776af03", + "url": "https://api.github.com/repos/symfony/translation/zipball/e6cd330e5a072518f88d65148f3f165541807494", + "reference": "e6cd330e5a072518f88d65148f3f165541807494", "shasum": "" }, "require": { @@ -5148,7 +5148,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.1.4" + "source": "https://github.com/symfony/translation/tree/v6.1.6" }, "funding": [ { @@ -5164,7 +5164,7 @@ "type": "tidelift" } ], - "time": "2022-08-02T16:17:38+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "symfony/translation-contracts", @@ -5249,16 +5249,16 @@ }, { "name": "symfony/twig-bridge", - "version": "v6.1.4", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "ec8da630a439a233817412fca93d14aa1813cc5d" + "reference": "368e9bac2dbaed85d943745b521077f8101b599d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/ec8da630a439a233817412fca93d14aa1813cc5d", - "reference": "ec8da630a439a233817412fca93d14aa1813cc5d", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/368e9bac2dbaed85d943745b521077f8101b599d", + "reference": "368e9bac2dbaed85d943745b521077f8101b599d", "shasum": "" }, "require": { @@ -5351,7 +5351,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v6.1.4" + "source": "https://github.com/symfony/twig-bridge/tree/v6.1.6" }, "funding": [ { @@ -5367,7 +5367,7 @@ "type": "tidelift" } ], - "time": "2022-08-04T19:19:00+00:00" + "time": "2022-10-12T05:10:31+00:00" }, { "name": "symfony/twig-bundle", @@ -5457,16 +5457,16 @@ }, { "name": "symfony/validator", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "7d7724f550e0f657a591831a7c31e25678ff8779" + "reference": "e5589882403e1e19774d7c5ffb65d9c6466d216c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/7d7724f550e0f657a591831a7c31e25678ff8779", - "reference": "7d7724f550e0f657a591831a7c31e25678ff8779", + "url": "https://api.github.com/repos/symfony/validator/zipball/e5589882403e1e19774d7c5ffb65d9c6466d216c", + "reference": "e5589882403e1e19774d7c5ffb65d9c6466d216c", "shasum": "" }, "require": { @@ -5545,7 +5545,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v6.1.5" + "source": "https://github.com/symfony/validator/tree/v6.1.6" }, "funding": [ { @@ -5561,20 +5561,20 @@ "type": "tidelift" } ], - "time": "2022-09-17T07:55:45+00:00" + "time": "2022-10-02T08:30:52+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "d0833493fb2413a86f522fb54a1896a7718e98ec" + "reference": "0f0adde127f24548e23cbde83bcaeadc491c551f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d0833493fb2413a86f522fb54a1896a7718e98ec", - "reference": "d0833493fb2413a86f522fb54a1896a7718e98ec", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0f0adde127f24548e23cbde83bcaeadc491c551f", + "reference": "0f0adde127f24548e23cbde83bcaeadc491c551f", "shasum": "" }, "require": { @@ -5633,7 +5633,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.1.5" + "source": "https://github.com/symfony/var-dumper/tree/v6.1.6" }, "funding": [ { @@ -5649,7 +5649,7 @@ "type": "tidelift" } ], - "time": "2022-09-08T09:34:40+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "symfony/var-exporter", @@ -5725,16 +5725,16 @@ }, { "name": "symfony/yaml", - "version": "v6.1.4", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "86ee4d8fa594ed45e40d86eedfda1bcb66c8d919" + "reference": "66c6b0cf52b00f74614a2cf7ae7db08ea1095931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/86ee4d8fa594ed45e40d86eedfda1bcb66c8d919", - "reference": "86ee4d8fa594ed45e40d86eedfda1bcb66c8d919", + "url": "https://api.github.com/repos/symfony/yaml/zipball/66c6b0cf52b00f74614a2cf7ae7db08ea1095931", + "reference": "66c6b0cf52b00f74614a2cf7ae7db08ea1095931", "shasum": "" }, "require": { @@ -5779,7 +5779,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.1.4" + "source": "https://github.com/symfony/yaml/tree/v6.1.6" }, "funding": [ { @@ -5795,7 +5795,7 @@ "type": "tidelift" } ], - "time": "2022-08-02T16:17:38+00:00" + "time": "2022-10-07T08:04:03+00:00" }, { "name": "twig/twig", @@ -6471,12 +6471,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "b0d3e99ce9c8ec237338a70277dd409ffcf6cedc" + "reference": "2e0b4657407c945bc54a1d73910fcf81fca58ec6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/b0d3e99ce9c8ec237338a70277dd409ffcf6cedc", - "reference": "b0d3e99ce9c8ec237338a70277dd409ffcf6cedc", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/2e0b4657407c945bc54a1d73910fcf81fca58ec6", + "reference": "2e0b4657407c945bc54a1d73910fcf81fca58ec6", "shasum": "" }, "conflict": { @@ -6527,7 +6527,7 @@ "cesnet/simplesamlphp-module-proxystatistics": "<3.1", "codeception/codeception": "<3.1.3|>=4,<4.1.22", "codeigniter/framework": "<=3.0.6", - "codeigniter4/framework": "<4.1.9", + "codeigniter4/framework": "<4.2.7", "codeigniter4/shield": "= 1.0.0-beta", "codiad/codiad": "<=2.8.4", "composer/composer": "<1.10.26|>=2-alpha.1,<2.2.12|>=2.3,<2.3.5", @@ -6690,6 +6690,9 @@ "matyhtf/framework": "<3.0.6", "mautic/core": "<4.3|= 2.13.1", "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35", + "melisplatform/melis-asset-manager": "<5.0.1", + "melisplatform/melis-cms": "<5.0.1", + "melisplatform/melis-front": "<5.0.1", "mezzio/mezzio-swoole": "<3.7|>=4,<4.3", "microweber/microweber": "<=1.3.1", "miniorange/miniorange-saml": "<1.4.3", @@ -6987,7 +6990,7 @@ "type": "tidelift" } ], - "time": "2022-10-05T15:07:13+00:00" + "time": "2022-10-11T21:05:01+00:00" }, { "name": "sebastian/cli-parser", @@ -8093,16 +8096,16 @@ }, { "name": "symfony/web-profiler-bundle", - "version": "v6.1.5", + "version": "v6.1.6", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "7e9381a776881a32e59d8072beac6859e2ddbbc7" + "reference": "45d05cd8e967fd06bb1f66f748ed308c00674d32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/7e9381a776881a32e59d8072beac6859e2ddbbc7", - "reference": "7e9381a776881a32e59d8072beac6859e2ddbbc7", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/45d05cd8e967fd06bb1f66f748ed308c00674d32", + "reference": "45d05cd8e967fd06bb1f66f748ed308c00674d32", "shasum": "" }, "require": { @@ -8151,7 +8154,7 @@ "description": "Provides a development tool that gives detailed information about the execution of any request", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.1.5" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.1.6" }, "funding": [ { @@ -8167,7 +8170,7 @@ "type": "tidelift" } ], - "time": "2022-08-31T08:17:45+00:00" + "time": "2022-10-02T08:30:52+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/services.yaml b/config/services.yaml index 98c72d7..da7e080 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -32,3 +32,6 @@ services: # App\Service\ExampleService: # arguments: # $someArgument: 'some_value' + _instanceof: + App\Types\AbstractEnumType: + tags: [ 'app.doctrine_enum_type' ] diff --git a/src/Controller/BrandCategoryController.php b/src/Controller/BrandCategoryController.php new file mode 100644 index 0000000..c664e4c --- /dev/null +++ b/src/Controller/BrandCategoryController.php @@ -0,0 +1,84 @@ +getRepository(BrandCategory::class) + ->findAll(); + + return $this->render('brand_category/index.html.twig', [ + 'brand_categories' => $brandCategories, + ]); + } + + #[Route('/new', name: 'brand-category_new', methods: ['GET', 'POST'])] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $brandCategory = new BrandCategory(); + $form = $this->createForm(BrandCategoryType::class, $brandCategory); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($brandCategory); + $entityManager->flush(); + + return $this->redirectToRoute('brand-category_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->renderForm('brand_category/new.html.twig', [ + 'brand_category' => $brandCategory, + 'form' => $form, + ]); + } + + #[Route('/{name}', name: 'brand-category_show', methods: ['GET'])] + public function show(BrandCategory $brandCategory): Response + { + return $this->render('brand_category/show.html.twig', [ + 'brand_category' => $brandCategory, + ]); + } + + #[Route('/{name}/edit', name: 'brand-category_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, BrandCategory $brandCategory, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(BrandCategoryType::class, $brandCategory); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('brand-category_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->renderForm('brand_category/edit.html.twig', [ + 'brand_category' => $brandCategory, + 'form' => $form, + ]); + } + + #[Route('/{name}', name: 'brand-category_delete', methods: ['POST'])] + public function delete(Request $request, BrandCategory $brandCategory, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$brandCategory->getName(), $request->request->get('_token'))) { + $entityManager->remove($brandCategory); + $entityManager->flush(); + } + + return $this->redirectToRoute('brand_category_index', [], Response::HTTP_SEE_OTHER); + } +} diff --git a/src/Entity/Brand.php b/src/Entity/Brand.php index b32ab15..c3282c9 100644 --- a/src/Entity/Brand.php +++ b/src/Entity/Brand.php @@ -2,6 +2,7 @@ namespace App\Entity; +use App\Repository\BrandRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; diff --git a/src/Entity/CameraTrait.php b/src/Entity/CameraTrait.php index 2b28653..689a722 100644 --- a/src/Entity/CameraTrait.php +++ b/src/Entity/CameraTrait.php @@ -15,37 +15,37 @@ trait CameraTrait #[ORM\ManyToOne(targetEntity: 'CameraType')] #[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id', nullable: FALSE)] - private readonly CameraType $type; + private CameraType $type; #[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: FALSE)] - private readonly string $brand; + private string $brand; #[ORM\Column(name: 'mount', type: 'string', length: 32, nullable: FALSE)] - private readonly string $mount; + private string $mount; #[ORM\Column(name: 'model', type: 'string', length: 255, nullable: FALSE)] - private readonly string $model; + private string $model; #[ORM\Column(name: 'is_digital', type: 'boolean', nullable: FALSE)] - private readonly bool $isDigital; + private bool $isDigital; #[ORM\Column(name: 'crop_factor', type: 'decimal', precision: 10, scale: 0, nullable: FALSE)] private string $cropFactor = '1.0'; #[ORM\Column(name: 'is_working', type: 'boolean', nullable: FALSE)] - private readonly bool $isWorking; + private bool $isWorking; #[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)] - private readonly ?string $notes; + private ?string $notes = null; #[ORM\Column(name: 'serial', type: 'string', length: 20, nullable: FALSE)] - private readonly string $serial; + private string $serial; #[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE)] private bool $formerlyOwned = FALSE; #[ORM\Column(name: 'battery_type', type: 'string', nullable: TRUE)] - private readonly ?string $batteryType; + private ?string $batteryType; #[ORM\Column(name: 'film_format', type: 'string', nullable: TRUE)] private ?string $filmFormat = '135'; @@ -142,7 +142,7 @@ trait CameraTrait return $this->isWorking; } - public function setNotes(string $notes): self + public function setNotes(?string $notes): self { $this->notes = $notes; diff --git a/src/Entity/Cpu.php b/src/Entity/Cpu.php new file mode 100644 index 0000000..c134f91 --- /dev/null +++ b/src/Entity/Cpu.php @@ -0,0 +1,39 @@ + 'asc'])] + #[ORM\JoinColumn(name: 'brand_id', referencedColumnName: 'id', nullable: FALSE)] + private Brand $brand; + + public function getId(): ?int + { + return $this->id; + } + + public function getBrand(): ?Brand + { + return $this->brand; + } + + public function setBrand(?Brand $brand): self + { + $this->brand = $brand; + + return $this; + } +} diff --git a/src/Entity/Gpu.php b/src/Entity/Gpu.php index 3fa7f26..9e6459b 100644 --- a/src/Entity/Gpu.php +++ b/src/Entity/Gpu.php @@ -2,6 +2,8 @@ namespace App\Entity; +use App\Enum\SlotKeyEnum; +use App\Types\SlotKeyEnumType; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; @@ -24,7 +26,7 @@ class Gpu #[ORM\ManyToOne(targetEntity: 'GpuCore')] #[ORM\OrderBy(['brand' => 'asc', 'name' => 'asc'])] #[ORM\JoinColumn(name: 'gpu_core_id', referencedColumnName: 'id', nullable: TRUE)] - private GpuCore $gpuCore; + private ?GpuCore $gpuCore = null; #[ORM\Column(name: 'reference_model_name', nullable: FALSE)] private string $modelName; @@ -37,8 +39,8 @@ class Gpu #[ORM\Column(name: 'alternate_model_name', nullable: TRUE)] private ?string $alternateModelName = ''; - #[ORM\Column(name: 'card_key', nullable: TRUE)] - private ?string $cardKey; + #[ORM\Column(name: 'card_key', type: SlotKeyEnumType::NAME, nullable: TRUE, enumType: SlotKeyEnum::class)] + private $cardKey = SlotKeyEnum::PCIE_X16; #[ORM\Column(name: 'bus_interface', nullable: TRUE)] private ?string $busInterface; @@ -56,7 +58,7 @@ class Gpu private int $pcie8power = 0; #[ORM\Column(name: 'tdp', nullable: TRUE)] - private readonly ?int $tdp; + private ?int $tdp = 0; #[ORM\Column(name: 'base_clock', nullable: TRUE)] private ?int $baseClock; @@ -150,12 +152,12 @@ class Gpu return $this; } - public function getCardKey(): ?string + public function getCardKey() { return $this->cardKey; } - public function setCardKey(?string $cardKey): self + public function setCardKey($cardKey): self { $this->cardKey = $cardKey; diff --git a/src/Entity/GpuCore.php b/src/Entity/GpuCore.php index 5014463..612a493 100644 --- a/src/Entity/GpuCore.php +++ b/src/Entity/GpuCore.php @@ -22,25 +22,25 @@ class GpuCore implements Stringable private Brand $brand; #[ORM\Column(name: 'name')] - private readonly string $name; + private string $name; #[ORM\Column(name: 'variant', nullable: TRUE)] - private readonly ?string $variant; + private ?string $variant; #[ORM\Column(name: 'generation_name')] - private readonly string $generationName; + private string $generationName; #[ORM\Column(name: 'generation_link', nullable: TRUE)] private ?string $generationLink = ''; #[ORM\Column(name: 'architecture')] - private readonly string $architecture; + private string $architecture; #[ORM\Column(name: 'architecture_link')] - private readonly string $architectureLink; + private string $architectureLink; #[ORM\Column(name: 'process_node', nullable: TRUE)] - private readonly ?int $processNode; + private ?int $processNode; public function __toString(): string { diff --git a/src/Enum/CardBusEnum.php b/src/Enum/CardBusEnum.php new file mode 100644 index 0000000..379a01c --- /dev/null +++ b/src/Enum/CardBusEnum.php @@ -0,0 +1,7 @@ + $case->name, $cases); + } + + public static function getValues(): array + { + $cases = self::cases(); + return array_map(static fn(UnitEnum $case) => $case->value, $cases); + } + + public static function getGroups(): array + { + return [ + 'PCI Express' => [ + self::PCIE_X16, + self::PCIE_X8, + self::PCIE_X4, + self::PCIE_X1, + ], + 'AGP' => [ + self::AGP_UNIVERSAL, + self::AGP_33V, + self::AGP_15V, + ], + 'PCI 32-bit' => [ + self::PCI_UNIVERSAL, + self::PCI_5V, + self::PCI_33V, + ], + 'PCI 64-bit' => [ + self::PCI_X, + self::PCI_64_UNIVERSAL, + self::PCI_64_33V, + self::PCI_64_5V, + ], + 'ISA' => [ + self::ISA_16, + self::ISA_8, + self::VLB, + ] + ]; + } +} diff --git a/src/Form/BrandCategoryType.php b/src/Form/BrandCategoryType.php new file mode 100644 index 0000000..34d7864 --- /dev/null +++ b/src/Form/BrandCategoryType.php @@ -0,0 +1,25 @@ +add('name') + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => BrandCategory::class, + ]); + } +} diff --git a/src/Form/GpuType.php b/src/Form/GpuType.php index d458a6d..6638748 100644 --- a/src/Form/GpuType.php +++ b/src/Form/GpuType.php @@ -2,10 +2,12 @@ namespace App\Form; +use App\Enum\SlotKeyEnum; use App\Entity\{Brand, Gpu, GpuCore}; use Doctrine\ORM\EntityRepository; use Symfony\Bridge\Doctrine\Form\Type\EntityType; -use Symfony\Component\Form\{AbstractType, FormBuilderInterface}; +use Symfony\Component\Form\ +{AbstractType, Extension\Core\Type\EnumType, FormBuilderInterface}; use Symfony\Component\OptionsResolver\OptionsResolver; class GpuType extends AbstractType @@ -23,6 +25,9 @@ class GpuType extends AbstractType ->add('gpuCore', EntityType::class, [ 'class' => GpuCore::class, 'query_builder' => static fn (EntityRepository $e) => $e->createQueryBuilder('gc')->orderBy('gc.brand', 'ASC')->orderBy('gc.name', 'ASC'), + 'placeholder' => 'Unknown', + 'empty_data' => NULL, + 'required' => false, ]) ->add('boardBrand', EntityType::class, [ 'class' => Brand::class, @@ -32,13 +37,17 @@ class GpuType extends AbstractType 'required' => false, ]) ->add('alternateModelName') - ->add('cardKey') + ->add('cardKey', EnumType::class, [ + 'class' => SlotKeyEnum::class, + 'choices' => SlotKeyEnum::getGroups(), + 'choice_label' => fn (\UnitEnum $choice):string => $choice->value, + ]) ->add('busInterface') ->add('slotWidth') ->add('molexPower', null, ['label' => 'Molex Power Connectors']) ->add('pcie6power', null, ['label' => 'PCIe 6-pin Power Connectors']) ->add('pcie8power', null, ['label' => 'PCIe 8-pin Power Connectors']) - ->add('tdp', null, ['label' => 'TDP (Watts)']) + ->add('tdp', null, ['label' => 'TDP (Watts)', 'empty_data' => '0']) ->add('baseClock', null, ['label' => 'GPU Base Clock (MHz)']) ->add('boostClock', null, ['label' => 'GPU Boost Clock (MHz)']) ->add('memoryClock', null, ['label' => 'Memory Speed (MHz)']) diff --git a/src/Kernel.php b/src/Kernel.php index 8f044a9..ae1685b 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -11,12 +11,15 @@ namespace App; +use App\Types\AbstractEnumType; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; -class Kernel extends BaseKernel +class Kernel extends BaseKernel implements CompilerPassInterface { use MicroKernelTrait; @@ -34,4 +37,19 @@ class Kernel extends BaseKernel $routes->import('../config/{routes}/*.yaml'); $routes->import('../config/{routes}.yaml'); } + + public function process(ContainerBuilder $container) + { + $typesDefinition = []; + if ($container->hasParameter('doctrine.dbal.connection_factory.types')) { + $typesDefinition = $container->getParameter('doctrine.dbal.connection_factory.types'); + } + + $taggedEnums = $container->findTaggedServiceIds('app.doctrine_enum_type'); + + foreach ($taggedEnums as $enumType => $definition) { + $typesDefinition[$enumType::NAME] = ['class' => $enumType]; + } + $container->setParameter('doctrine.dbal.connection_factory.types', $typesDefinition); + } } diff --git a/src/Types/AbstractEnumType.php b/src/Types/AbstractEnumType.php new file mode 100644 index 0000000..a593467 --- /dev/null +++ b/src/Types/AbstractEnumType.php @@ -0,0 +1,44 @@ +value; + } + + return $value; + } + + public function convertToPHPValue($value, AbstractPlatform $platform): mixed + { + if (false === enum_exists($this::getEnumsClass(), true)) + { + throw new \LogicException("This class should be an enum"); + } + + $enum = $this::getEnumsClass(); + + return $enum::from($value); + } + + abstract public static function getEnumsClass(): string; +} diff --git a/src/Types/CardBusEnumType.php b/src/Types/CardBusEnumType.php new file mode 100644 index 0000000..05413f3 --- /dev/null +++ b/src/Types/CardBusEnumType.php @@ -0,0 +1,19 @@ +Edit Brand Category + +
+ +
+ +
+ {{ form_start(form) }} + {{ form_widget(form) }} + + {{ form_end(form) }} + +
+ + +
+
+{% endblock %} diff --git a/templates/brand_category/index.html.twig b/templates/brand_category/index.html.twig new file mode 100644 index 0000000..7fac3a5 --- /dev/null +++ b/templates/brand_category/index.html.twig @@ -0,0 +1,45 @@ +{% extends 'form.html.twig' %} + +{% block title %}Brand Categories{% endblock %} + +{% block form %} +

Brand Categories

+ +
+ +
+ + + + + + + + + + {% for brand_category in brand_categories %} + + + + + {% else %} + + + + {% endfor %} + +
 Name
+ + {{ brand_category.name }}
no records found
+{% endblock %} diff --git a/templates/brand_category/new.html.twig b/templates/brand_category/new.html.twig new file mode 100644 index 0000000..4e4ef92 --- /dev/null +++ b/templates/brand_category/new.html.twig @@ -0,0 +1,22 @@ +{% extends 'form.html.twig' %} + +{% block title %}New Brand Category{% endblock %} + +{% block form %} +

Create new Brand Category

+ +
+ +
+ +
+ {{ form_start(form) }} + {{ form_widget(form) }} + + {{ form_end(form) }} +
+{% endblock %} diff --git a/templates/brand_category/show.html.twig b/templates/brand_category/show.html.twig new file mode 100644 index 0000000..8eb2bb2 --- /dev/null +++ b/templates/brand_category/show.html.twig @@ -0,0 +1,39 @@ +{% extends 'form.html.twig' %} + +{% block title %}Brand Category{% endblock %} + +{% block form %} +

Brand Category

+ +
+ + + +
+ + +
+ + +
+
+ +
+ + + + + + + +
Name{{ brand_category.name }}
+
+{% endblock %} diff --git a/templates/gpu/index.html.twig b/templates/gpu/index.html.twig index 21ee005..a9cfded 100644 --- a/templates/gpu/index.html.twig +++ b/templates/gpu/index.html.twig @@ -81,15 +81,17 @@ {{ gpu.id }} {{ gpu.gpuBrand.name }} {{ gpu.modelName }} - {% if gpu.gpuCore.variant %} - {{ gpu.gpuCore.name }} ({{ gpu.gpuCore.variant }}) - {% else %} - {{ gpu.gpuCore.name }} + {% if gpu.gpuCore %} + {% if gpu.gpuCore.variant %} + {{ gpu.gpuCore.name }} ({{ gpu.gpuCore.variant }}) + {% else %} + {{ gpu.gpuCore.name }} + {% endif %} {% endif %} {% if gpu.boardBrand %}{{ gpu.boardBrand.name }}{% else %}Unknown{% endif %} {{ gpu.alternateModelName }} - {{ gpu.cardKey }} + {{ gpu.cardKey.value }} {{ gpu.busInterface }} {{ gpu.slotWidth }} @@ -196,7 +198,7 @@ {% if gpu.boardBrand %}{{ gpu.boardBrand.name }}{% else %}Unknown{% endif %} {{ gpu.alternateModelName }} - {{ gpu.cardKey }} + {{ gpu.cardKey.value }} {{ gpu.busInterface }} {{ gpu.slotWidth }} diff --git a/templates/gpu/show.html.twig b/templates/gpu/show.html.twig index 0a824f0..ade3ea6 100644 --- a/templates/gpu/show.html.twig +++ b/templates/gpu/show.html.twig @@ -42,7 +42,7 @@ CardKey - {{ gpu.cardKey }} + {{ gpu.cardKey.value }} BusInterface diff --git a/templates/header.html.twig b/templates/header.html.twig index f292677..9f0b5ed 100644 --- a/templates/header.html.twig +++ b/templates/header.html.twig @@ -6,8 +6,8 @@
  • 🕺 Brands
  • -
  • - 💃 Brand Categories +
  • + 💃 Brand Categories