From e5f5ef10d0f5f2825974b48a05e57925c1698df5 Mon Sep 17 00:00:00 2001 From: aB0t Date: Fri, 2 Jun 2023 04:47:47 +0200 Subject: [PATCH] update 2023-06-02 04:47:47 --- README.md | 14 + .../README.md | 53 +++ .../code.php | 77 ++++ .../code.power | 48 ++ .../settings.json | 30 ++ .../README.md | 6 +- .../code.php | 18 +- .../code.power | 12 +- .../settings.json | 10 +- .../README.md | 14 +- .../code.php | 28 +- .../code.power | 26 +- .../settings.json | 2 +- .../README.md | 85 ++++ .../code.php | 149 +++++++ .../code.power | 116 +++++ .../settings.json | 46 ++ .../README.md | 28 +- .../code.php | 57 ++- .../code.power | 52 ++- .../settings.json | 14 +- .../README.md | 8 +- .../code.php | 10 +- .../code.power | 8 +- .../settings.json | 2 +- .../README.md | 2 +- .../code.php | 11 +- .../code.power | 8 +- .../settings.json | 6 +- .../README.md | 21 + .../code.php | 23 + .../code.power | 1 + .../settings.json | 18 + .../README.md | 85 ++++ .../code.php | 141 ++++++ .../code.power | 109 +++++ .../settings.json | 41 ++ .../README.md | 89 ++++ .../code.php | 159 +++++++ .../code.power | 132 ++++++ .../settings.json | 27 ++ .../README.md | 19 +- .../code.php | 29 +- .../code.power | 27 +- .../settings.json | 2 +- .../README.md | 2 +- .../code.php | 4 +- .../code.power | 2 +- .../settings.json | 2 +- .../README.md | 85 ++++ .../code.php | 141 ++++++ .../code.power | 109 +++++ .../settings.json | 41 ++ .../README.md | 2 +- .../code.php | 4 +- .../code.power | 2 +- .../settings.json | 10 +- .../README.md | 2 +- .../code.php | 4 +- .../code.power | 2 +- .../settings.json | 2 +- .../README.md | 12 +- .../code.php | 25 +- .../code.power | 23 +- .../settings.json | 2 +- .../README.md | 76 ++++ .../code.php | 147 +++++++ .../code.power | 119 +++++ .../settings.json | 31 ++ .../README.md | 6 +- .../code.php | 8 +- .../code.power | 6 +- .../settings.json | 2 +- .../README.md | 89 ++++ .../code.php | 159 +++++++ .../code.power | 132 ++++++ .../settings.json | 27 ++ .../README.md | 42 ++ .../code.php | 44 ++ .../code.power | 18 + .../settings.json | 18 + .../README.md | 4 +- .../code.php | 8 +- .../code.power | 6 +- .../settings.json | 2 +- .../README.md | 29 ++ .../code.php | 415 ++++++++++++++++++ .../code.power | 7 + .../settings.json | 20 + super-powers.json | 110 +++++ 90 files changed, 3742 insertions(+), 122 deletions(-) create mode 100644 src/116eb429-bc51-4d14-b9aa-7145c86a29d1/README.md create mode 100644 src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.php create mode 100644 src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.power create mode 100644 src/116eb429-bc51-4d14-b9aa-7145c86a29d1/settings.json create mode 100644 src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/README.md create mode 100644 src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.php create mode 100644 src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.power create mode 100644 src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/settings.json create mode 100644 src/8336e3c4-f11b-41bc-a2b1-976f99442a84/README.md create mode 100644 src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.php create mode 100644 src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.power create mode 100644 src/8336e3c4-f11b-41bc-a2b1-976f99442a84/settings.json create mode 100644 src/91b37bd7-b314-48be-91cf-434ec823bd80/README.md create mode 100644 src/91b37bd7-b314-48be-91cf-434ec823bd80/code.php create mode 100644 src/91b37bd7-b314-48be-91cf-434ec823bd80/code.power create mode 100644 src/91b37bd7-b314-48be-91cf-434ec823bd80/settings.json create mode 100644 src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/README.md create mode 100644 src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.php create mode 100644 src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.power create mode 100644 src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/settings.json create mode 100644 src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/README.md create mode 100644 src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.php create mode 100644 src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.power create mode 100644 src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/settings.json create mode 100644 src/c03b9c61-17d3-4774-a335-783903719f83/README.md create mode 100644 src/c03b9c61-17d3-4774-a335-783903719f83/code.php create mode 100644 src/c03b9c61-17d3-4774-a335-783903719f83/code.power create mode 100644 src/c03b9c61-17d3-4774-a335-783903719f83/settings.json create mode 100644 src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/README.md create mode 100644 src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.php create mode 100644 src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.power create mode 100644 src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/settings.json create mode 100644 src/f815fb33-f721-48a5-a84e-53f1986e8881/README.md create mode 100644 src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php create mode 100644 src/f815fb33-f721-48a5-a84e-53f1986e8881/code.power create mode 100644 src/f815fb33-f721-48a5-a84e-53f1986e8881/settings.json create mode 100644 src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/README.md create mode 100644 src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.php create mode 100644 src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.power create mode 100644 src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/settings.json diff --git a/README.md b/README.md index 2c97dec..e04bea3 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,10 @@ This repository contains an index (see below) of all the approved powers within - **Namespace**: [VDM\Joomla\GetBible](#vdm-joomla-getbible) - **abstract class Factory** | [Details](src/11892cfa-374e-4e3f-b0bc-531871c822d9) | [Code](src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php) | [Settings](src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json) | Super__11892cfa_374e_4e3f_b0bc_531871c822d9__Power + - **final class Search** | [Details](src/8336e3c4-f11b-41bc-a2b1-976f99442a84) | [Code](src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.php) | [Settings](src/8336e3c4-f11b-41bc-a2b1-976f99442a84/settings.json) | Super__8336e3c4_f11b_41bc_a2b1_976f99442a84__Power + - **final class Watcher** | [Details](src/f815fb33-f721-48a5-a84e-53f1986e8881) | [Code](src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php) | [Settings](src/f815fb33-f721-48a5-a84e-53f1986e8881/settings.json) | Super__f815fb33_f721_48a5_a84e_53f1986e8881__Power - **class Config** | [Details](src/71075f03-4e77-4fc0-840a-ef55fd9260b2) | [Code](src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php) | [Settings](src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json) | Super__71075f03_4e77_4fc0_840a_ef55fd9260b2__Power + - **class Table** | [Details](src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068) | [Code](src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.php) | [Settings](src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/settings.json) | Super__ff8d5fdb_2d1f_4178_bd18_a43b8efd1068__Power - **Namespace**: [VDM\Joomla\GetBible\Abstraction](#vdm-joomla-getbible-abstraction) - **abstract class Api** | [Details](src/7b490e63-8d1f-46de-a0c4-154272fd5d7f) | [Code](src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php) | [Settings](src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json) | Super__7b490e63_8d1f_46de_a0c4_154272fd5d7f__Power @@ -36,10 +39,21 @@ This repository contains an index (see below) of all the approved powers within - **final class Chapters** | [Details](src/a752e4b2-9b5e-4188-8d33-3799c46d5119) | [Code](src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php) | [Settings](src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json) | Super__a752e4b2_9b5e_4188_8d33_3799c46d5119__Power - **final class Translations** | [Details](src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0) | [Code](src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php) | [Settings](src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json) | Super__be0cae8b_4b78_4f59_b97b_9e31ee6f52e0__Power - **final class Verses** | [Details](src/afa508bf-78f8-4616-97cc-f2809584c086) | [Code](src/afa508bf-78f8-4616-97cc-f2809584c086/code.php) | [Settings](src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json) | Super__afa508bf_78f8_4616_97cc_f2809584c086__Power +- **Namespace**: [VDM\Joomla\GetBible\Database](#vdm-joomla-getbible-database) + + - **final class Insert** | [Details](src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf) | [Code](src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.php) | [Settings](src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/settings.json) | Super__a07d90f6_6ff2_40a1_99c1_0f2cf33c9adf__Power + - **final class Load** | [Details](src/c03b9c61-17d3-4774-a335-783903719f83) | [Code](src/c03b9c61-17d3-4774-a335-783903719f83/code.php) | [Settings](src/c03b9c61-17d3-4774-a335-783903719f83/settings.json) | Super__c03b9c61_17d3_4774_a335_783903719f83__Power + - **final class Update** | [Details](src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e) | [Code](src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.php) | [Settings](src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/settings.json) | Super__d7a5f0c6_de60_4d31_b3e4_5d668a8f7d2e__Power +- **Namespace**: [VDM\Joomla\GetBible\Model](#vdm-joomla-getbible-model) + + - **final class Load** | [Details](src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0) | [Code](src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.php) | [Settings](src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/settings.json) | Super__b1bd2b4f_dede_44ad_86e9_2a595a0a9ca0__Power + - **final class Upsert** | [Details](src/91b37bd7-b314-48be-91cf-434ec823bd80) | [Code](src/91b37bd7-b314-48be-91cf-434ec823bd80/code.php) | [Settings](src/91b37bd7-b314-48be-91cf-434ec823bd80/settings.json) | Super__91b37bd7_b314_48be_91cf_434ec823bd80__Power - **Namespace**: [VDM\Joomla\GetBible\Service](#vdm-joomla-getbible-service) - **class Api** | [Details](src/b32eea04-6b9c-469d-94db-35d610686cf1) | [Code](src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php) | [Settings](src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json) | Super__b32eea04_6b9c_469d_94db_35d610686cf1__Power - **class App** | [Details](src/56465044-94ed-4e00-b6db-160c67163df8) | [Code](src/56465044-94ed-4e00-b6db-160c67163df8/code.php) | [Settings](src/56465044-94ed-4e00-b6db-160c67163df8/settings.json) | Super__56465044_94ed_4e00_b6db_160c67163df8__Power + - **class Database** | [Details](src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38) | [Code](src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.php) | [Settings](src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/settings.json) | Super__51bb0397_fa7c_4f7a_a4c5_1f95fdacad38__Power + - **class Model** | [Details](src/116eb429-bc51-4d14-b9aa-7145c86a29d1) | [Code](src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.php) | [Settings](src/116eb429-bc51-4d14-b9aa-7145c86a29d1/settings.json) | Super__116eb429_bc51_4d14_b9aa_7145c86a29d1__Power - **class Utilities** | [Details](src/b89d74ef-c71c-4a58-8455-5dbdfe94027a) | [Code](src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/code.php) | [Settings](src/b89d74ef-c71c-4a58-8455-5dbdfe94027a/settings.json) | Super__b89d74ef_c71c_4a58_8455_5dbdfe94027a__Power - **Namespace**: [VDM\Joomla\GetBible\Utilities](#vdm-joomla-getbible-utilities) diff --git a/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/README.md b/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/README.md new file mode 100644 index 0000000..14eec52 --- /dev/null +++ b/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/README.md @@ -0,0 +1,53 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Model (Details) +> namespace: **VDM\Joomla\GetBible\Service** +```uml +@startuml +class Model #Gold { + + register(Container $container) : void + + getUpsert(Container $container) : Upsert + + getLoad(Container $container) : Load +} + +note right of Model::register + Registers the service provider with a DI container. + + since: 2.0.1 + return: void +end note + +note right of Model::getUpsert + Get the Upsert class + + since: 2.0.1 + return: Upsert +end note + +note right of Model::getLoad + Get the Load class + + since: 2.0.1 + return: Load +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.php b/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.php new file mode 100644 index 0000000..2fd9db7 --- /dev/null +++ b/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.php @@ -0,0 +1,77 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\GetBible\Model\Upsert; +use VDM\Joomla\GetBible\Model\Load; + + +/** + * The GetBible Model Service + * + * @since 2.0.1 + */ +class Model implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 2.0.1 + */ + public function register(Container $container) + { + $container->alias(Upsert::class, 'GetBible.Model.Upsert') + ->share('GetBible.Model.Upsert', [$this, 'getUpsert'], true); + + $container->alias(Load::class, 'GetBible.Model.Load') + ->share('GetBible.Model.Load', [$this, 'getLoad'], true); + } + + /** + * Get the Upsert class + * + * @param Container $container The DI container. + * + * @return Upsert + * @since 2.0.1 + */ + public function getUpsert(Container $container): Upsert + { + return new Upsert( + $container->get('GetBible.Config'), + $container->get('GetBible.Table') + ); + } + + /** + * Get the Load class + * + * @param Container $container The DI container. + * + * @return Load + * @since 2.0.1 + */ + public function getLoad(Container $container): Load + { + return new Load( + $container->get('GetBible.Config'), + $container->get('GetBible.Table') + ); + } +} + diff --git a/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.power b/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.power new file mode 100644 index 0000000..b81d844 --- /dev/null +++ b/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/code.power @@ -0,0 +1,48 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 2.0.1 + */ + public function register(Container $container) + { + $container->alias(Upsert::class, 'GetBible.Model.Upsert') + ->share('GetBible.Model.Upsert', [$this, 'getUpsert'], true); + + $container->alias(Load::class, 'GetBible.Model.Load') + ->share('GetBible.Model.Load', [$this, 'getLoad'], true); + } + + /** + * Get the Upsert class + * + * @param Container $container The DI container. + * + * @return Upsert + * @since 2.0.1 + */ + public function getUpsert(Container $container): Upsert + { + return new Upsert( + $container->get('GetBible.Config'), + $container->get('GetBible.Table') + ); + } + + /** + * Get the Load class + * + * @param Container $container The DI container. + * + * @return Load + * @since 2.0.1 + */ + public function getLoad(Container $container): Load + { + return new Load( + $container->get('GetBible.Config'), + $container->get('GetBible.Table') + ); + } \ No newline at end of file diff --git a/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/settings.json b/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/settings.json new file mode 100644 index 0000000..798e00d --- /dev/null +++ b/src/116eb429-bc51-4d14-b9aa-7145c86a29d1/settings.json @@ -0,0 +1,30 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "116eb429-bc51-4d14-b9aa-7145c86a29d1", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Model", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Service.Model", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "91b37bd7-b314-48be-91cf-434ec823bd80", + "as": "default" + }, + "use_selection1": { + "use": "b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Service.Model", + "description": "The GetBible Model Service\r\n\r\n@since 2.0.1", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/README.md b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/README.md index 722fed3..565fc78 100644 --- a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/README.md +++ b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/README.md @@ -20,21 +20,21 @@ abstract Factory #Orange { note right of Factory::_ Get any class from the package container - since: 3.2.0 + since: 2.0.1 return: Mixed end note note right of Factory::getContainer Get the global package container - since: 3.2.0 + since: 2.0.1 return: Container end note note right of Factory::createContainer Create a container object - since: 3.2.0 + since: 2.0.1 return: Container end note diff --git a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php index 00c4be9..4bdbfb9 100644 --- a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php +++ b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.php @@ -16,13 +16,15 @@ use Joomla\DI\Container; use VDM\Joomla\GetBible\Service\Api; use VDM\Joomla\GetBible\Service\Utilities; use VDM\Joomla\GetBible\Service\App; -use VDM\Joomla\Componentbuilder\Interfaces\FactoryInterface; +use VDM\Joomla\GetBible\Service\Model; +use VDM\Joomla\GetBible\Service\Database; +use VDM\Joomla\Interfaces\FactoryInterface; /** * GetBible Factory * - * @since 3.2.0 + * @since 2.0.1 */ abstract class Factory implements FactoryInterface { @@ -30,7 +32,7 @@ abstract class Factory implements FactoryInterface * Global Package Container * * @var Container - * @since 3.2.0 + * @since 2.0.1 **/ protected static $container = null; @@ -40,7 +42,7 @@ abstract class Factory implements FactoryInterface * @param string $key The container class key * * @return Mixed - * @since 3.2.0 + * @since 2.0.1 */ public static function _($key) { @@ -51,7 +53,7 @@ abstract class Factory implements FactoryInterface * Get the global package container * * @return Container - * @since 3.2.0 + * @since 2.0.1 */ public static function getContainer(): Container { @@ -67,14 +69,16 @@ abstract class Factory implements FactoryInterface * Create a container object * * @return Container - * @since 3.2.0 + * @since 2.0.1 */ protected static function createContainer(): Container { return (new Container()) ->registerServiceProvider(new Utilities()) ->registerServiceProvider(new Api()) - ->registerServiceProvider(new App()); + ->registerServiceProvider(new App()) + ->registerServiceProvider(new Model()) + ->registerServiceProvider(new Database()); } } diff --git a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.power b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.power index 75be52c..a619731 100644 --- a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.power +++ b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/code.power @@ -2,7 +2,7 @@ * Global Package Container * * @var Container - * @since 3.2.0 + * @since 2.0.1 **/ protected static $container = null; @@ -12,7 +12,7 @@ * @param string $key The container class key * * @return Mixed - * @since 3.2.0 + * @since 2.0.1 */ public static function _($key) { @@ -23,7 +23,7 @@ * Get the global package container * * @return Container - * @since 3.2.0 + * @since 2.0.1 */ public static function getContainer(): Container { @@ -39,12 +39,14 @@ * Create a container object * * @return Container - * @since 3.2.0 + * @since 2.0.1 */ protected static function createContainer(): Container { return (new Container()) ->registerServiceProvider(new Utilities()) ->registerServiceProvider(new Api()) - ->registerServiceProvider(new App()); + ->registerServiceProvider(new App()) + ->registerServiceProvider(new Model()) + ->registerServiceProvider(new Database()); } \ No newline at end of file diff --git a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json index 16ee53a..4568bc5 100644 --- a/src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json +++ b/src/11892cfa-374e-4e3f-b0bc-531871c822d9/settings.json @@ -23,10 +23,18 @@ "use_selection2": { "use": "56465044-94ed-4e00-b6db-160c67163df8", "as": "default" + }, + "use_selection4": { + "use": "116eb429-bc51-4d14-b9aa-7145c86a29d1", + "as": "default" + }, + "use_selection3": { + "use": "51bb0397-fa7c-4f7a-a4c5-1f95fdacad38", + "as": "default" } }, "namespace": "VDM\\Joomla\\GetBible\\Factory", - "description": "GetBible Factory\r\n\r\n@since 3.2.0", + "description": "GetBible Factory\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "use Joomla\\DI\\Container;", "composer": "" diff --git a/src/491c91ce-6355-40d3-bbbd-622473c6c026/README.md b/src/491c91ce-6355-40d3-bbbd-622473c6c026/README.md index 547338a..5e0f6e9 100644 --- a/src/491c91ce-6355-40d3-bbbd-622473c6c026/README.md +++ b/src/491c91ce-6355-40d3-bbbd-622473c6c026/README.md @@ -14,28 +14,36 @@ class Books << (F,LightGreen) >> #Green { + get(string $translation = 'kjv') : ?object + list(string $translation = 'kjv') : ?object + checksum(string $translation = 'kjv') : ?object + + sha(int $book, string $translation = 'kjv') : ?string } note right of Books::get Get the books in a translation - since: 3.2.0 + since: 2.0.1 return: ?object end note note right of Books::list List the books in a translation - since: 3.2.0 + since: 2.0.1 return: ?object end note note right of Books::checksum List the books checksums in a translation - since: 3.2.0 + since: 2.0.1 return: ?object end note + +note right of Books::sha + Get the book's checksums in a translation + + since: 2.0.1 + return: ?string +end note @enduml ``` diff --git a/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php b/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php index 10dae9a..ec71da8 100644 --- a/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php +++ b/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.php @@ -18,7 +18,7 @@ use VDM\Joomla\GetBible\Abstraction\Api; /** * The GetBible Books * - * @since 3.2.0 + * @since 2.0.1 */ final class Books extends Api { @@ -28,7 +28,7 @@ final class Books extends Api * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function get(string $translation = 'kjv'): ?object { @@ -45,7 +45,7 @@ final class Books extends Api * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function list(string $translation = 'kjv'): ?object { @@ -62,7 +62,7 @@ final class Books extends Api * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function checksum(string $translation = 'kjv'): ?object { @@ -71,6 +71,26 @@ final class Books extends Api $this->uri->get($translation . '/checksum.json') ) ); + } + + /** + * Get the book's checksums in a translation + * + * @param int $book The book number. + * @param string $translation The translation. + * + * @return string|null The response checksums or null if an error occurs. + * @since 2.0.1 + */ + public function sha(int $book, string $translation = 'kjv'): ?string + { + return trim( + $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '.sha') + ) + ) + ); } } diff --git a/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.power b/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.power index e65cb9f..41730ad 100644 --- a/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.power +++ b/src/491c91ce-6355-40d3-bbbd-622473c6c026/code.power @@ -4,7 +4,7 @@ * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function get(string $translation = 'kjv'): ?object { @@ -21,7 +21,7 @@ * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function list(string $translation = 'kjv'): ?object { @@ -38,7 +38,7 @@ * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function checksum(string $translation = 'kjv'): ?object { @@ -47,4 +47,24 @@ $this->uri->get($translation . '/checksum.json') ) ); + } + + /** + * Get the book's checksums in a translation + * + * @param int $book The book number. + * @param string $translation The translation. + * + * @return string|null The response checksums or null if an error occurs. + * @since 2.0.1 + */ + public function sha(int $book, string $translation = 'kjv'): ?string + { + return trim( + $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '.sha') + ) + ) + ); } \ No newline at end of file diff --git a/src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json b/src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json index bf1cf08..90f5a3d 100644 --- a/src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json +++ b/src/491c91ce-6355-40d3-bbbd-622473c6c026/settings.json @@ -11,7 +11,7 @@ "type": "final class", "use_selection": null, "namespace": "VDM\\Joomla\\GetBible\\Api.Books", - "description": "The GetBible Books\r\n\r\n@since 3.2.0", + "description": "The GetBible Books\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/README.md b/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/README.md new file mode 100644 index 0000000..7b1813c --- /dev/null +++ b/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/README.md @@ -0,0 +1,85 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Database (Details) +> namespace: **VDM\Joomla\GetBible\Service** +```uml +@startuml +class Database #Gold { + + register(Container $container) : void + + getBaseUpdate(Container $container) : BaseUpdate + + getBaseInsert(Container $container) : BaseInsert + + getBaseLoad(Container $container) : BaseLoad + + getInsert(Container $container) : Insert + + getUpdate(Container $container) : Update + + getLoad(Container $container) : Load +} + +note right of Database::register + Registers the service provider with a DI container. + + since: 2.0.1 + return: void +end note + +note right of Database::getBaseUpdate + Get the BaseUpdate class + + since: 2.0.1 + return: BaseUpdate +end note + +note right of Database::getBaseInsert + Get the BaseInsert class + + since: 2.0.1 + return: BaseInsert +end note + +note right of Database::getBaseLoad + Get the BaseLoad class + + since: 2.0.1 + return: BaseLoad +end note + +note right of Database::getInsert + Get the Insert class + + since: 2.0.1 + return: Insert +end note + +note right of Database::getUpdate + Get the Update class + + since: 2.0.1 + return: Update +end note + +note right of Database::getLoad + Get the Table class + + since: 2.0.1 + return: Load +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.php b/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.php new file mode 100644 index 0000000..b1a7039 --- /dev/null +++ b/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.php @@ -0,0 +1,149 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Database\Insert as BaseInsert; +use VDM\Joomla\Database\Update as BaseUpdate; +use VDM\Joomla\Database\Load as BaseLoad; +use VDM\Joomla\GetBible\Database\Insert; +use VDM\Joomla\GetBible\Database\Load; +use VDM\Joomla\GetBible\Database\Update; + + +/** + * The GetBible Database Service + * + * @since 2.0.1 + */ +class Database implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 2.0.1 + */ + public function register(Container $container) + { + $container->alias(BaseInsert::class, 'DB.Insert') + ->share('DB.Insert', [$this, 'getBaseInsert'], true); + + $container->alias(BaseUpdate::class, 'DB.Update') + ->share('DB.Update', [$this, 'getBaseUpdate'], true); + + $container->alias(BaseLoad::class, 'DB.Load') + ->share('DB.Load', [$this, 'getBaseLoad'], true); + + $container->alias(Insert::class, 'GetBible.Insert') + ->share('GetBible.Insert', [$this, 'getInsert'], true); + + $container->alias(Update::class, 'GetBible.Update') + ->share('GetBible.Update', [$this, 'getUpdate'], true); + + $container->alias(Load::class, 'GetBible.Load') + ->share('GetBible.Load', [$this, 'getLoad'], true); + } + + /** + * Get the BaseUpdate class + * + * @param Container $container The DI container. + * + * @return BaseUpdate + * @since 2.0.1 + */ + public function getBaseUpdate(Container $container): BaseUpdate + { + return new BaseUpdate(); + } + + /** + * Get the BaseInsert class + * + * @param Container $container The DI container. + * + * @return BaseInsert + * @since 2.0.1 + */ + public function getBaseInsert(Container $container): BaseInsert + { + return new BaseInsert(); + } + + /** + * Get the BaseLoad class + * + * @param Container $container The DI container. + * + * @return BaseLoad + * @since 2.0.1 + */ + public function getBaseLoad(Container $container): BaseLoad + { + return new BaseLoad(); + } + + /** + * Get the Insert class + * + * @param Container $container The DI container. + * + * @return Insert + * @since 2.0.1 + */ + public function getInsert(Container $container): Insert + { + return new Insert( + $container->get('GetBible.Model.Upsert'), + $container->get('DB.Insert') + ); + } + + /** + * Get the Update class + * + * @param Container $container The DI container. + * + * @return Update + * @since 2.0.1 + */ + public function getUpdate(Container $container): Update + { + return new Update( + $container->get('GetBible.Model.Upsert'), + $container->get('DB.Update') + ); + } + + /** + * Get the Table class + * + * @param Container $container The DI container. + * + * @return Load + * @since 2.0.1 + */ + public function getLoad(Container $container): Load + { + return new Load( + $container->get('GetBible.Table'), + $container->get('GetBible.Model.Load'), + $container->get('DB.Load') + ); + } +} + diff --git a/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.power b/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.power new file mode 100644 index 0000000..453f383 --- /dev/null +++ b/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/code.power @@ -0,0 +1,116 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 2.0.1 + */ + public function register(Container $container) + { + $container->alias(BaseInsert::class, 'DB.Insert') + ->share('DB.Insert', [$this, 'getBaseInsert'], true); + + $container->alias(BaseUpdate::class, 'DB.Update') + ->share('DB.Update', [$this, 'getBaseUpdate'], true); + + $container->alias(BaseLoad::class, 'DB.Load') + ->share('DB.Load', [$this, 'getBaseLoad'], true); + + $container->alias(Insert::class, 'GetBible.Insert') + ->share('GetBible.Insert', [$this, 'getInsert'], true); + + $container->alias(Update::class, 'GetBible.Update') + ->share('GetBible.Update', [$this, 'getUpdate'], true); + + $container->alias(Load::class, 'GetBible.Load') + ->share('GetBible.Load', [$this, 'getLoad'], true); + } + + /** + * Get the BaseUpdate class + * + * @param Container $container The DI container. + * + * @return BaseUpdate + * @since 2.0.1 + */ + public function getBaseUpdate(Container $container): BaseUpdate + { + return new BaseUpdate(); + } + + /** + * Get the BaseInsert class + * + * @param Container $container The DI container. + * + * @return BaseInsert + * @since 2.0.1 + */ + public function getBaseInsert(Container $container): BaseInsert + { + return new BaseInsert(); + } + + /** + * Get the BaseLoad class + * + * @param Container $container The DI container. + * + * @return BaseLoad + * @since 2.0.1 + */ + public function getBaseLoad(Container $container): BaseLoad + { + return new BaseLoad(); + } + + /** + * Get the Insert class + * + * @param Container $container The DI container. + * + * @return Insert + * @since 2.0.1 + */ + public function getInsert(Container $container): Insert + { + return new Insert( + $container->get('GetBible.Model.Upsert'), + $container->get('DB.Insert') + ); + } + + /** + * Get the Update class + * + * @param Container $container The DI container. + * + * @return Update + * @since 2.0.1 + */ + public function getUpdate(Container $container): Update + { + return new Update( + $container->get('GetBible.Model.Upsert'), + $container->get('DB.Update') + ); + } + + /** + * Get the Table class + * + * @param Container $container The DI container. + * + * @return Load + * @since 2.0.1 + */ + public function getLoad(Container $container): Load + { + return new Load( + $container->get('GetBible.Table'), + $container->get('GetBible.Model.Load'), + $container->get('DB.Load') + ); + } \ No newline at end of file diff --git a/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/settings.json b/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/settings.json new file mode 100644 index 0000000..84e316e --- /dev/null +++ b/src/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38/settings.json @@ -0,0 +1,46 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "51bb0397-fa7c-4f7a-a4c5-1f95fdacad38", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Database", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Service.Database", + "type": "class", + "use_selection": { + "use_selection4": { + "use": "524eb8f6-38d4-47dc-92ad-98b94e099ac0", + "as": "BaseInsert" + }, + "use_selection5": { + "use": "cce56585-58b0-4f72-a92c-e2635ea52d83", + "as": "BaseUpdate" + }, + "use_selection6": { + "use": "06f8eada-d59b-441c-b287-0aea1793da5a", + "as": "BaseLoad" + }, + "use_selection0": { + "use": "a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf", + "as": "default" + }, + "use_selection1": { + "use": "c03b9c61-17d3-4774-a335-783903719f83", + "as": "default" + }, + "use_selection2": { + "use": "d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Service.Database", + "description": "The GetBible Database Service\r\n\r\n@since 2.0.1", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/56465044-94ed-4e00-b6db-160c67163df8/README.md b/src/56465044-94ed-4e00-b6db-160c67163df8/README.md index 05813cd..6d62db4 100644 --- a/src/56465044-94ed-4e00-b6db-160c67163df8/README.md +++ b/src/56465044-94ed-4e00-b6db-160c67163df8/README.md @@ -13,21 +13,45 @@ class App #Gold { + register(Container $container) : void + getConfig(Container $container) : Config + + getTable(Container $container) : Table + + getSearch(Container $container) : Search + + getWatcher(Container $container) : Watcher } note right of App::register Registers the service provider with a DI container. - since: 3.2.0 + since: 2.0.1 return: void end note note right of App::getConfig Get the Config class - since: 3.2.0 + since: 2.0.1 return: Config end note + +note right of App::getTable + Get the Table class + + since: 2.0.1 + return: Table +end note + +note right of App::getSearch + Get the Search class + + since: 2.0.1 + return: Search +end note + +note right of App::getWatcher + Get the Watcher class + + since: 2.0.1 + return: Watcher +end note @enduml ``` diff --git a/src/56465044-94ed-4e00-b6db-160c67163df8/code.php b/src/56465044-94ed-4e00-b6db-160c67163df8/code.php index 4c6d996..17def17 100644 --- a/src/56465044-94ed-4e00-b6db-160c67163df8/code.php +++ b/src/56465044-94ed-4e00-b6db-160c67163df8/code.php @@ -15,12 +15,15 @@ namespace VDM\Joomla\GetBible\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\GetBible\Config; +use VDM\Joomla\GetBible\Table; +use VDM\Joomla\GetBible\Search; +use VDM\Joomla\GetBible\Watcher; /** * The GetBible App Service * - * @since 3.2.0 + * @since 2.0.1 */ class App implements ServiceProviderInterface { @@ -30,12 +33,21 @@ class App implements ServiceProviderInterface * @param Container $container The DI container. * * @return void - * @since 3.2.0 + * @since 2.0.1 */ public function register(Container $container) { $container->alias(Config::class, 'GetBible.Config') ->share('GetBible.Config', [$this, 'getConfig'], true); + + $container->alias(Table::class, 'GetBible.Table') + ->share('GetBible.Table', [$this, 'getTable'], true); + + $container->alias(Search::class, 'GetBible.Search') + ->share('GetBible.Search', [$this, 'getSearch'], true); + + $container->alias(Watcher::class, 'GetBible.Watcher') + ->share('GetBible.Watcher', [$this, 'getWatcher'], true); } /** @@ -44,11 +56,50 @@ class App implements ServiceProviderInterface * @param Container $container The DI container. * * @return Config - * @since 3.2.0 + * @since 2.0.1 */ public function getConfig(Container $container): Config { return new Config(); + } + + /** + * Get the Table class + * + * @param Container $container The DI container. + * + * @return Table + * @since 2.0.1 + */ + public function getTable(Container $container): Table + { + return new Table(); + } + + /** + * Get the Search class + * + * @param Container $container The DI container. + * + * @return Search + * @since 2.0.1 + */ + public function getSearch(Container $container): Search + { + return new Search(); + } + + /** + * Get the Watcher class + * + * @param Container $container The DI container. + * + * @return Watcher + * @since 2.0.1 + */ + public function getWatcher(Container $container): Watcher + { + return new Watcher(); } } diff --git a/src/56465044-94ed-4e00-b6db-160c67163df8/code.power b/src/56465044-94ed-4e00-b6db-160c67163df8/code.power index 2f78a07..4a78df0 100644 --- a/src/56465044-94ed-4e00-b6db-160c67163df8/code.power +++ b/src/56465044-94ed-4e00-b6db-160c67163df8/code.power @@ -4,12 +4,21 @@ * @param Container $container The DI container. * * @return void - * @since 3.2.0 + * @since 2.0.1 */ public function register(Container $container) { $container->alias(Config::class, 'GetBible.Config') ->share('GetBible.Config', [$this, 'getConfig'], true); + + $container->alias(Table::class, 'GetBible.Table') + ->share('GetBible.Table', [$this, 'getTable'], true); + + $container->alias(Search::class, 'GetBible.Search') + ->share('GetBible.Search', [$this, 'getSearch'], true); + + $container->alias(Watcher::class, 'GetBible.Watcher') + ->share('GetBible.Watcher', [$this, 'getWatcher'], true); } /** @@ -18,9 +27,48 @@ * @param Container $container The DI container. * * @return Config - * @since 3.2.0 + * @since 2.0.1 */ public function getConfig(Container $container): Config { return new Config(); + } + + /** + * Get the Table class + * + * @param Container $container The DI container. + * + * @return Table + * @since 2.0.1 + */ + public function getTable(Container $container): Table + { + return new Table(); + } + + /** + * Get the Search class + * + * @param Container $container The DI container. + * + * @return Search + * @since 2.0.1 + */ + public function getSearch(Container $container): Search + { + return new Search(); + } + + /** + * Get the Watcher class + * + * @param Container $container The DI container. + * + * @return Watcher + * @since 2.0.1 + */ + public function getWatcher(Container $container): Watcher + { + return new Watcher(); } \ No newline at end of file diff --git a/src/56465044-94ed-4e00-b6db-160c67163df8/settings.json b/src/56465044-94ed-4e00-b6db-160c67163df8/settings.json index 36cb597..eeaf8ca 100644 --- a/src/56465044-94ed-4e00-b6db-160c67163df8/settings.json +++ b/src/56465044-94ed-4e00-b6db-160c67163df8/settings.json @@ -15,10 +15,22 @@ "use_selection0": { "use": "71075f03-4e77-4fc0-840a-ef55fd9260b2", "as": "default" + }, + "use_selection1": { + "use": "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068", + "as": "default" + }, + "use_selection3": { + "use": "8336e3c4-f11b-41bc-a2b1-976f99442a84", + "as": "default" + }, + "use_selection2": { + "use": "f815fb33-f721-48a5-a84e-53f1986e8881", + "as": "default" } }, "namespace": "VDM\\Joomla\\GetBible\\Service.App", - "description": "The GetBible App Service\r\n\r\n@since 3.2.0", + "description": "The GetBible App Service\r\n\r\n@since 2.0.1", "implements_custom": "ServiceProviderInterface", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", diff --git a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/README.md b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/README.md index 88d2bb6..586c85c 100644 --- a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/README.md +++ b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/README.md @@ -20,28 +20,28 @@ class Config #Gold { note right of Config::getEndpoint get Bible API url - since: 3.2.0 + since: 2.0.1 return: ?string end note note right of Config::getSchema get Bible API Schema - since: 3.2.0 + since: 2.0.1 return: ?string end note note right of Config::getDomain get Bible API domain - since: 3.2.0 + since: 2.0.1 return: ?string end note note right of Config::getVersion get Bible version - since: 3.2.0 + since: 2.0.1 return: ?string end note diff --git a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php index 56533dc..0526c2c 100644 --- a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php +++ b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.php @@ -18,7 +18,7 @@ use VDM\Joomla\Abstraction\BaseConfig; /** * GetBible Configurations * - * @since 3.2.0 + * @since 2.0.1 */ class Config extends BaseConfig { @@ -26,7 +26,7 @@ class Config extends BaseConfig * get Bible API url * * @return string The API Endpoint - * @since 3.2.0 + * @since 2.0.1 */ protected function getEndpoint(): ?string { @@ -37,7 +37,7 @@ class Config extends BaseConfig * get Bible API Schema * * @return string The Get Bible Schema - * @since 3.2.0 + * @since 2.0.1 */ protected function getSchema(): ?string { @@ -48,7 +48,7 @@ class Config extends BaseConfig * get Bible API domain * * @return string The Get Bible Domain - * @since 3.2.0 + * @since 2.0.1 */ protected function getDomain(): ?string { @@ -59,7 +59,7 @@ class Config extends BaseConfig * get Bible version * * @return string The Get Bible Version - * @since 3.2.0 + * @since 2.0.1 */ protected function getVersion(): ?string { diff --git a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.power b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.power index 59d20c0..f2a54a3 100644 --- a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.power +++ b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/code.power @@ -2,7 +2,7 @@ * get Bible API url * * @return string The API Endpoint - * @since 3.2.0 + * @since 2.0.1 */ protected function getEndpoint(): ?string { @@ -13,7 +13,7 @@ * get Bible API Schema * * @return string The Get Bible Schema - * @since 3.2.0 + * @since 2.0.1 */ protected function getSchema(): ?string { @@ -24,7 +24,7 @@ * get Bible API domain * * @return string The Get Bible Domain - * @since 3.2.0 + * @since 2.0.1 */ protected function getDomain(): ?string { @@ -35,7 +35,7 @@ * get Bible version * * @return string The Get Bible Version - * @since 3.2.0 + * @since 2.0.1 */ protected function getVersion(): ?string { diff --git a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json index 2f7eca7..0eff836 100644 --- a/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json +++ b/src/71075f03-4e77-4fc0-840a-ef55fd9260b2/settings.json @@ -11,7 +11,7 @@ "type": "class", "use_selection": null, "namespace": "VDM\\Joomla\\GetBible\\Config", - "description": "GetBible Configurations\r\n\r\n@since 3.2.0", + "description": "GetBible Configurations\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/README.md b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/README.md index 9278de8..42b93f7 100644 --- a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/README.md +++ b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/README.md @@ -20,7 +20,7 @@ abstract Api #Orange { note right of Api::__construct Constructor. - since: 3.2.0 + since: 2.0.1 arguments: Http $http diff --git a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php index 2254458..c2b23ca 100644 --- a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php +++ b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.php @@ -12,7 +12,6 @@ namespace VDM\Joomla\GetBible\Abstraction; -use Joomla\Uri\Uri as JoomlaUri; use VDM\Joomla\GetBible\Utilities\Http; use VDM\Joomla\GetBible\Utilities\Uri; use VDM\Joomla\GetBible\Utilities\Response; @@ -21,7 +20,7 @@ use VDM\Joomla\GetBible\Utilities\Response; /** * The GetBible Api * - * @since 3.2.0 + * @since 2.0.1 */ abstract class Api { @@ -29,7 +28,7 @@ abstract class Api * The Http class * * @var Http - * @since 3.2.0 + * @since 2.0.1 */ protected Http $http; @@ -37,7 +36,7 @@ abstract class Api * The Uri class * * @var Uri - * @since 3.2.0 + * @since 2.0.1 */ protected Uri $uri; @@ -45,7 +44,7 @@ abstract class Api * The Response class * * @var Response - * @since 3.2.0 + * @since 2.0.1 */ protected Response $response; @@ -56,7 +55,7 @@ abstract class Api * @param Uri $uri The uri class. * @param Response $response The response class. * - * @since 3.2.0 + * @since 2.0.1 **/ public function __construct(Http $http, Uri $uri, Response $response) { diff --git a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.power b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.power index 7f1d19e..d9716f5 100644 --- a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.power +++ b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/code.power @@ -2,7 +2,7 @@ * The Http class * * @var Http - * @since 3.2.0 + * @since 2.0.1 */ protected Http $http; @@ -10,7 +10,7 @@ * The Uri class * * @var Uri - * @since 3.2.0 + * @since 2.0.1 */ protected Uri $uri; @@ -18,7 +18,7 @@ * The Response class * * @var Response - * @since 3.2.0 + * @since 2.0.1 */ protected Response $response; @@ -29,7 +29,7 @@ * @param Uri $uri The uri class. * @param Response $response The response class. * - * @since 3.2.0 + * @since 2.0.1 **/ public function __construct(Http $http, Uri $uri, Response $response) { diff --git a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json index 2b214e5..c6f9e05 100644 --- a/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json +++ b/src/7b490e63-8d1f-46de-a0c4-154272fd5d7f/settings.json @@ -1,5 +1,5 @@ { - "add_head": "1", + "add_head": "0", "add_licensing_template": "2", "extends": "0", "guid": "7b490e63-8d1f-46de-a0c4-154272fd5d7f", @@ -24,8 +24,8 @@ } }, "namespace": "VDM\\Joomla\\GetBible\\Abstraction.Api", - "description": "The GetBible Api\r\n\r\n@since 3.2.0", + "description": "The GetBible Api\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", - "head": "use Joomla\\Uri\\Uri as JoomlaUri;", + "head": "", "composer": "" } \ No newline at end of file diff --git a/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/README.md b/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/README.md new file mode 100644 index 0000000..8e5d4c1 --- /dev/null +++ b/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/README.md @@ -0,0 +1,21 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +> Error adding class diagram + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.php b/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.php new file mode 100644 index 0000000..7483592 --- /dev/null +++ b/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.php @@ -0,0 +1,23 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible; + + +/** + * The GetBible Search + * + * @since 2.0.1 + */ +final class Search +{ +} + diff --git a/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.power b/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.power new file mode 100644 index 0000000..69309b0 --- /dev/null +++ b/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/code.power @@ -0,0 +1 @@ +###CODEPOWER### \ No newline at end of file diff --git a/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/settings.json b/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/settings.json new file mode 100644 index 0000000..27f1757 --- /dev/null +++ b/src/8336e3c4-f11b-41bc-a2b1-976f99442a84/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "8336e3c4-f11b-41bc-a2b1-976f99442a84", + "implements": null, + "load_selection": null, + "name": "Search", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Search", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Search", + "description": "The GetBible Search\r\n\r\n@since 2.0.1", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/91b37bd7-b314-48be-91cf-434ec823bd80/README.md b/src/91b37bd7-b314-48be-91cf-434ec823bd80/README.md new file mode 100644 index 0000000..b34e308 --- /dev/null +++ b/src/91b37bd7-b314-48be-91cf-434ec823bd80/README.md @@ -0,0 +1,85 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Upsert (Details) +> namespace: **VDM\Joomla\GetBible\Model** +```uml +@startuml +class Upsert << (F,LightGreen) >> #Green { + # Config $config + + __construct(Config $config, Table $table) + + value(mixed $value, string $field, ...) : mixed + # validateBefore(mixed $value, ?string $field = null, ...) : bool + # validateAfter(mixed $value, ?string $field = null, ...) : bool + # getTable() : string +} + +note right of Upsert::__construct + Constructor + + since: 2.0.1 +end note + +note right of Upsert::value + Model the value +Example: $this->value(value, 'field_key', 'table_name'); + + since: 2.0.1 + return: mixed + + arguments: + mixed $value + string $field + ?string $table = null +end note + +note right of Upsert::validateBefore + Validate before the value is modelled + + since: 2.0.1 + return: bool + + arguments: + mixed $value + ?string $field = null + ?string $table = null +end note + +note right of Upsert::validateAfter + Validate after the value is modelled + + since: 2.0.1 + return: bool + + arguments: + mixed $value + ?string $field = null + ?string $table = null +end note + +note right of Upsert::getTable + Get the current active table + + since: 2.0.1 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/91b37bd7-b314-48be-91cf-434ec823bd80/code.php b/src/91b37bd7-b314-48be-91cf-434ec823bd80/code.php new file mode 100644 index 0000000..240eee4 --- /dev/null +++ b/src/91b37bd7-b314-48be-91cf-434ec823bd80/code.php @@ -0,0 +1,141 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Model; + + +use VDM\Joomla\GetBible\Config; +use VDM\Joomla\GetBible\Table; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Interfaces\ModelInterface; +use VDM\Joomla\Abstraction\Model; + + +/** + * The GetBible Model for both Update and Insert + * + * @since 2.0.1 + */ +final class Upsert extends Model implements ModelInterface +{ + /** + * GetBible Config + * + * @var Config + * @since 2.0.1 + */ + protected Config $config; + + /** + * Constructor + * + * @param Config $config The getBible config object. + * @param Table $table The getBible table object. + * + * @since 2.0.1 + */ + public function __construct(Config $config, Table $table) + { + parent::__construct($table); + + $this->config = $config; + } + + /** + * Model the value + * Example: $this->value(value, 'field_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 2.0.1 + */ + public function value($value, string $field, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->getTable(); + } + + // check if this is a valid table + if (($store = $this->table->get($table, $field, 'store')) !== null) + { + // open the value based on the store method + switch($store) + { + case 'json': + $value = json_encode($value, JSON_FORCE_OBJECT); + break; + } + } + + return $value; + } + + /** + * Validate before the value is modelled + * + * @param mixed $value The field value + * @param string|null $field The field key + * @param string|null $table The table + * + * @return bool + * @since 2.0.1 + */ + protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool + { + // check values + if (StringHelper::check($value) || ArrayHelper::check($value, true) || ObjectHelper::check($value) || is_numeric($value)) + { + return true; + } + // remove empty values + return false; + } + + /** + * Validate after the value is modelled + * + * @param mixed $value The field value + * @param string|null $field The field key + * @param string|null $table The table + * + * @return bool + * @since 2.0.1 + */ + protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool + { + // only strings or numbers allowed + if (StringHelper::check($value) || is_numeric($value)) + { + return true; + } + // remove empty values + return false; + } + + /** + * Get the current active table + * + * @return string + * @since 2.0.1 + */ + protected function getTable(): string + { + return $this->config->table_name; + } +} + diff --git a/src/91b37bd7-b314-48be-91cf-434ec823bd80/code.power b/src/91b37bd7-b314-48be-91cf-434ec823bd80/code.power new file mode 100644 index 0000000..8fbcc07 --- /dev/null +++ b/src/91b37bd7-b314-48be-91cf-434ec823bd80/code.power @@ -0,0 +1,109 @@ + /** + * GetBible Config + * + * @var Config + * @since 2.0.1 + */ + protected Config $config; + + /** + * Constructor + * + * @param Config $config The getBible config object. + * @param Table $table The getBible table object. + * + * @since 2.0.1 + */ + public function __construct(Config $config, Table $table) + { + parent::__construct($table); + + $this->config = $config; + } + + /** + * Model the value + * Example: $this->value(value, 'field_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 2.0.1 + */ + public function value($value, string $field, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->getTable(); + } + + // check if this is a valid table + if (($store = $this->table->get($table, $field, 'store')) !== null) + { + // open the value based on the store method + switch($store) + { + case 'json': + $value = json_encode($value, JSON_FORCE_OBJECT); + break; + } + } + + return $value; + } + + /** + * Validate before the value is modelled + * + * @param mixed $value The field value + * @param string|null $field The field key + * @param string|null $table The table + * + * @return bool + * @since 2.0.1 + */ + protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool + { + // check values + if (StringHelper::check($value) || ArrayHelper::check($value, true) || ObjectHelper::check($value) || is_numeric($value)) + { + return true; + } + // remove empty values + return false; + } + + /** + * Validate after the value is modelled + * + * @param mixed $value The field value + * @param string|null $field The field key + * @param string|null $table The table + * + * @return bool + * @since 2.0.1 + */ + protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool + { + // only strings or numbers allowed + if (StringHelper::check($value) || is_numeric($value)) + { + return true; + } + // remove empty values + return false; + } + + /** + * Get the current active table + * + * @return string + * @since 2.0.1 + */ + protected function getTable(): string + { + return $this->config->table_name; + } \ No newline at end of file diff --git a/src/91b37bd7-b314-48be-91cf-434ec823bd80/settings.json b/src/91b37bd7-b314-48be-91cf-434ec823bd80/settings.json new file mode 100644 index 0000000..4732fbc --- /dev/null +++ b/src/91b37bd7-b314-48be-91cf-434ec823bd80/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "584747d1-3a86-453d-b7a3-a2219de8d777", + "guid": "91b37bd7-b314-48be-91cf-434ec823bd80", + "implements": [ + "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff" + ], + "load_selection": null, + "name": "Upsert", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Model.Upsert", + "type": "final class", + "use_selection": { + "use_selection3": { + "use": "71075f03-4e77-4fc0-840a-ef55fd9260b2", + "as": "default" + }, + "use_selection4": { + "use": "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068", + "as": "default" + }, + "use_selection0": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection2": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Model.Upsert", + "description": "The GetBible Model for both Update and Insert\r\n\r\n@since 2.0.1", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/README.md b/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/README.md new file mode 100644 index 0000000..654934b --- /dev/null +++ b/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/README.md @@ -0,0 +1,89 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Insert (Details) +> namespace: **VDM\Joomla\GetBible\Database** +```uml +@startuml +class Insert << (F,LightGreen) >> #Green { + # Model $model + # Database $database + + __construct(Model $model, Database $database) + + value(mixed $value, string $field, ...) : bool + + row(array $item) : bool + + rows(?array $items) : bool + + item(object $item) : bool + + items(?array $items) : bool +} + +note right of Insert::__construct + Constructor + + since: 2.0.1 +end note + +note right of Insert::value + Insert a value to a given table +Example: $this->value(Value, 'value_key', 'GUID'); + + since: 2.0.1 + return: bool + + arguments: + mixed $value + string $field + string $keyValue + string $key = 'guid' +end note + +note right of Insert::row + Insert single row with multiple values to a given table +Example: $this->item(Array); + + since: 2.0.1 + return: bool +end note + +note right of Insert::rows + Insert multiple rows to a given table +Example: $this->items(Array); + + since: 2.0.1 + return: bool +end note + +note right of Insert::item + Insert single item with multiple values to a given table +Example: $this->item(Object); + + since: 2.0.1 + return: bool +end note + +note right of Insert::items + Insert multiple items to a given table +Example: $this->items(Array); + + since: 2.0.1 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.php b/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.php new file mode 100644 index 0000000..4ed87f5 --- /dev/null +++ b/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.php @@ -0,0 +1,159 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Database; + + +use VDM\Joomla\GetBible\Model\Upsert as Model; +use VDM\Joomla\Database\Insert as Database; + + +/** + * GetBible Database Insert + * + * @since 2.0.1 + */ +final class Insert +{ + /** + * Model + * + * @var Model + * @since 2.0.1 + */ + protected Model $model; + + /** + * Database + * + * @var Database + * @since 2.0.1 + */ + protected Database $database; + + /** + * Constructor + * + * @param Model $model The set model object. + * @param Database $database The insert database object. + * + * @since 2.0.1 + */ + public function __construct(Model $model, Database $database) + { + $this->model = $model; + $this->database = $database; + } + + /** + * Insert a value to a given table + * Example: $this->value(Value, 'value_key', 'GUID'); + * + * @param mixed $value The field value + * @param string $field The field key + * @param string $keyValue The key value + * @param string $key The key name + * + * @return bool + * @since 2.0.1 + */ + public function value($value, string $field, string $keyValue, string $key = 'guid'): bool + { + // build the array + $item = []; + $item[$key] = $keyValue; + $item[$field] = $value; + + // Insert the column of this table + return $this->row($item); + } + + /** + * Insert single row with multiple values to a given table + * Example: $this->item(Array); + * + * @param array $item The item to save + * + * @return bool + * @since 2.0.1 + */ + public function row(array $item): bool + { + // check if object could be modelled + if (($item = $this->model->row($item, 'power')) !== null) + { + // Insert the column of this table + return $this->database->row($item, 'power'); + } + return false; + } + + /** + * Insert multiple rows to a given table + * Example: $this->items(Array); + * + * @param array|null $items The items updated in database (array of arrays) + * + * @return bool + * @since 2.0.1 + */ + public function rows(?array $items): bool + { + // check if object could be modelled + if (($items = $this->model->rows($items, 'power')) !== null) + { + // Insert the column of this table + return $this->database->rows($items, 'power'); + } + return false; + } + + /** + * Insert single item with multiple values to a given table + * Example: $this->item(Object); + * + * @param object $item The item to save + * + * @return bool + * @since 2.0.1 + */ + public function item(object $item): bool + { + // check if object could be modelled + if (($item = $this->model->item($item, 'power')) !== null) + { + // Insert the column of this table + return $this->database->item($item, 'power'); + } + return false; + } + + /** + * Insert multiple items to a given table + * Example: $this->items(Array); + * + * @param array|null $items The items updated in database (array of objects) + * + * @return bool + * @since 2.0.1 + */ + public function items(?array $items): bool + { + // check if object could be modelled + if (($items = $this->model->items($items, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->items($items, 'power'); + } + return false; + } +} + diff --git a/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.power b/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.power new file mode 100644 index 0000000..e1fe369 --- /dev/null +++ b/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/code.power @@ -0,0 +1,132 @@ + /** + * Model + * + * @var Model + * @since 2.0.1 + */ + protected Model $model; + + /** + * Database + * + * @var Database + * @since 2.0.1 + */ + protected Database $database; + + /** + * Constructor + * + * @param Model $model The set model object. + * @param Database $database The insert database object. + * + * @since 2.0.1 + */ + public function __construct(Model $model, Database $database) + { + $this->model = $model; + $this->database = $database; + } + + /** + * Insert a value to a given table + * Example: $this->value(Value, 'value_key', 'GUID'); + * + * @param mixed $value The field value + * @param string $field The field key + * @param string $keyValue The key value + * @param string $key The key name + * + * @return bool + * @since 2.0.1 + */ + public function value($value, string $field, string $keyValue, string $key = 'guid'): bool + { + // build the array + $item = []; + $item[$key] = $keyValue; + $item[$field] = $value; + + // Insert the column of this table + return $this->row($item); + } + + /** + * Insert single row with multiple values to a given table + * Example: $this->item(Array); + * + * @param array $item The item to save + * + * @return bool + * @since 2.0.1 + */ + public function row(array $item): bool + { + // check if object could be modelled + if (($item = $this->model->row($item, 'power')) !== null) + { + // Insert the column of this table + return $this->database->row($item, 'power'); + } + return false; + } + + /** + * Insert multiple rows to a given table + * Example: $this->items(Array); + * + * @param array|null $items The items updated in database (array of arrays) + * + * @return bool + * @since 2.0.1 + */ + public function rows(?array $items): bool + { + // check if object could be modelled + if (($items = $this->model->rows($items, 'power')) !== null) + { + // Insert the column of this table + return $this->database->rows($items, 'power'); + } + return false; + } + + /** + * Insert single item with multiple values to a given table + * Example: $this->item(Object); + * + * @param object $item The item to save + * + * @return bool + * @since 2.0.1 + */ + public function item(object $item): bool + { + // check if object could be modelled + if (($item = $this->model->item($item, 'power')) !== null) + { + // Insert the column of this table + return $this->database->item($item, 'power'); + } + return false; + } + + /** + * Insert multiple items to a given table + * Example: $this->items(Array); + * + * @param array|null $items The items updated in database (array of objects) + * + * @return bool + * @since 2.0.1 + */ + public function items(?array $items): bool + { + // check if object could be modelled + if (($items = $this->model->items($items, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->items($items, 'power'); + } + return false; + } \ No newline at end of file diff --git a/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/settings.json b/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/settings.json new file mode 100644 index 0000000..7785e7d --- /dev/null +++ b/src/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf", + "implements": null, + "load_selection": null, + "name": "Insert", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Database.Insert", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "91b37bd7-b314-48be-91cf-434ec823bd80", + "as": "Model" + }, + "use_selection1": { + "use": "524eb8f6-38d4-47dc-92ad-98b94e099ac0", + "as": "Database" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Database.Insert", + "description": "GetBible Database Insert\r\n\r\n@since 2.0.1", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/README.md b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/README.md index 51dcdf3..0dd76d2 100644 --- a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/README.md +++ b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/README.md @@ -14,28 +14,41 @@ class Chapters << (F,LightGreen) >> #Green { + get(int $book, string $translation = 'kjv') : ?object + list(int $book, string $translation = 'kjv') : ?object + checksum(int $book, string $translation = 'kjv') : ?object + + sha(int $chapter, int $book, ...) : ?string } note right of Chapters::get Get the chapters in a book in a translation - since: 3.2.0 + since: 2.0.1 return: ?object end note note right of Chapters::list List the chapters of a book in a translation - since: 3.2.0 + since: 2.0.1 return: ?object end note note right of Chapters::checksum List the chapters checksums of a book in a translation - since: 3.2.0 + since: 2.0.1 return: ?object end note + +note right of Chapters::sha + Get the chapter's checksums of a book in a translation + + since: 2.0.1 + return: ?string + + arguments: + int $chapter + int $book + string $translation = 'kjv' +end note @enduml ``` diff --git a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php index d5a9593..26d0dd2 100644 --- a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php +++ b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.php @@ -18,7 +18,7 @@ use VDM\Joomla\GetBible\Abstraction\Api; /** * The GetBible Book Chapters * - * @since 3.2.0 + * @since 2.0.1 */ final class Chapters extends Api { @@ -29,7 +29,7 @@ final class Chapters extends Api * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function get(int $book, string $translation = 'kjv'): ?object { @@ -47,7 +47,7 @@ final class Chapters extends Api * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function list(int $book, string $translation = 'kjv'): ?object { @@ -65,7 +65,7 @@ final class Chapters extends Api * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function checksum(int $book, string $translation = 'kjv'): ?object { @@ -74,6 +74,27 @@ final class Chapters extends Api $this->uri->get($translation . '/' . $book . '/checksum.json') ) ); + } + + /** + * Get the chapter's checksums of a book in a translation + * + * @param int $chapter The chapter number. + * @param int $book The book number. + * @param string $translation The translation. + * + * @return string|null The response checksum or null if an error occurs. + * @since 2.0.1 + */ + public function sha(int $chapter, int $book, string $translation = 'kjv'): ?string + { + return trim( + $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/' . $chapter . '.sha') + ) + ) + ); } } diff --git a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.power b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.power index 5dde518..981fa46 100644 --- a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.power +++ b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/code.power @@ -5,7 +5,7 @@ * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function get(int $book, string $translation = 'kjv'): ?object { @@ -23,7 +23,7 @@ * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function list(int $book, string $translation = 'kjv'): ?object { @@ -41,7 +41,7 @@ * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function checksum(int $book, string $translation = 'kjv'): ?object { @@ -50,4 +50,25 @@ $this->uri->get($translation . '/' . $book . '/checksum.json') ) ); + } + + /** + * Get the chapter's checksums of a book in a translation + * + * @param int $chapter The chapter number. + * @param int $book The book number. + * @param string $translation The translation. + * + * @return string|null The response checksum or null if an error occurs. + * @since 2.0.1 + */ + public function sha(int $chapter, int $book, string $translation = 'kjv'): ?string + { + return trim( + $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/' . $chapter . '.sha') + ) + ) + ); } \ No newline at end of file diff --git a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json index 8317e85..c24f11f 100644 --- a/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json +++ b/src/a752e4b2-9b5e-4188-8d33-3799c46d5119/settings.json @@ -11,7 +11,7 @@ "type": "final class", "use_selection": null, "namespace": "VDM\\Joomla\\GetBible\\Api.Chapters", - "description": "The GetBible Book Chapters\r\n\r\n@since 3.2.0", + "description": "The GetBible Book Chapters\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/afa508bf-78f8-4616-97cc-f2809584c086/README.md b/src/afa508bf-78f8-4616-97cc-f2809584c086/README.md index 8cbe0ce..4b0182c 100644 --- a/src/afa508bf-78f8-4616-97cc-f2809584c086/README.md +++ b/src/afa508bf-78f8-4616-97cc-f2809584c086/README.md @@ -17,7 +17,7 @@ class Verses << (F,LightGreen) >> #Green { note right of Verses::get Get the verses of chapter in a book in a translation - since: 3.2.0 + since: 2.0.1 return: ?object arguments: diff --git a/src/afa508bf-78f8-4616-97cc-f2809584c086/code.php b/src/afa508bf-78f8-4616-97cc-f2809584c086/code.php index 9aea223..d64835c 100644 --- a/src/afa508bf-78f8-4616-97cc-f2809584c086/code.php +++ b/src/afa508bf-78f8-4616-97cc-f2809584c086/code.php @@ -18,7 +18,7 @@ use VDM\Joomla\GetBible\Abstraction\Api; /** * The GetBible Book Chapter Verses * - * @since 3.2.0 + * @since 2.0.1 */ final class Verses extends Api { @@ -30,7 +30,7 @@ final class Verses extends Api * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function get(int $chapter, int $book, string $translation = 'kjv'): ?object { diff --git a/src/afa508bf-78f8-4616-97cc-f2809584c086/code.power b/src/afa508bf-78f8-4616-97cc-f2809584c086/code.power index 0fe8f65..d98f6ea 100644 --- a/src/afa508bf-78f8-4616-97cc-f2809584c086/code.power +++ b/src/afa508bf-78f8-4616-97cc-f2809584c086/code.power @@ -6,7 +6,7 @@ * @param string $translation The translation. * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function get(int $chapter, int $book, string $translation = 'kjv'): ?object { diff --git a/src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json b/src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json index 0265eb1..3f98d22 100644 --- a/src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json +++ b/src/afa508bf-78f8-4616-97cc-f2809584c086/settings.json @@ -11,7 +11,7 @@ "type": "final class", "use_selection": null, "namespace": "VDM\\Joomla\\GetBible\\Api.Verses", - "description": "The GetBible Book Chapter Verses\r\n\r\n@since 3.2.0", + "description": "The GetBible Book Chapter Verses\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/README.md b/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/README.md new file mode 100644 index 0000000..5d200d3 --- /dev/null +++ b/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/README.md @@ -0,0 +1,85 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Load (Details) +> namespace: **VDM\Joomla\GetBible\Model** +```uml +@startuml +class Load << (F,LightGreen) >> #Green { + # Config $config + + __construct(Config $config, Table $table) + + value(mixed $value, string $field, ...) : mixed + # validateBefore(mixed $value, ?string $field = null, ...) : bool + # validateAfter(mixed $value, ?string $field = null, ...) : bool + # getTable() : string +} + +note right of Load::__construct + Constructor + + since: 2.0.1 +end note + +note right of Load::value + Model the value +Example: $this->value(value, 'field_key', 'table_name'); + + since: 2.0.1 + return: mixed + + arguments: + mixed $value + string $field + ?string $table = null +end note + +note right of Load::validateBefore + Validate before the value is modelled + + since: 2.0.1 + return: bool + + arguments: + mixed $value + ?string $field = null + ?string $table = null +end note + +note right of Load::validateAfter + Validate after the value is modelled + + since: 2.0.1 + return: bool + + arguments: + mixed $value + ?string $field = null + ?string $table = null +end note + +note right of Load::getTable + Get the current active table + + since: 2.0.1 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.php b/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.php new file mode 100644 index 0000000..da64002 --- /dev/null +++ b/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.php @@ -0,0 +1,141 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Model; + + +use VDM\Joomla\GetBible\Config; +use VDM\Joomla\GetBible\Table; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Interfaces\ModelInterface; +use VDM\Joomla\Abstraction\Model; + + +/** + * The GetBible Model to Load + * + * @since 2.0.1 + */ +final class Load extends Model implements ModelInterface +{ + /** + * GetBible Config + * + * @var Config + * @since 2.0.1 + */ + protected Config $config; + + /** + * Constructor + * + * @param Config $config The getBible config object. + * @param Table $table The getBible table object. + * + * @since 2.0.1 + */ + public function __construct(Config $config, Table $table) + { + parent::__construct($table); + + $this->config = $config; + } + + /** + * Model the value + * Example: $this->value(value, 'field_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 2.0.1 + */ + public function value($value, string $field, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->getTable(); + } + + // check if this is a valid table + if (($store = $this->table->get($table, $field, 'store')) !== null) + { + // open the value based on the store method + switch($store) + { + case 'json': + $value = json_decode($value); + break; + } + } + + return $value; + } + + /** + * Validate before the value is modelled + * + * @param mixed $value The field value + * @param string|null $field The field key + * @param string|null $table The table + * + * @return bool + * @since 2.0.1 + */ + protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool + { + // only strings or numbers allowed + if (StringHelper::check($value) || is_numeric($value)) + { + return true; + } + // remove empty values + return false; + } + + /** + * Validate after the value is modelled + * + * @param mixed $value The field value + * @param string|null $field The field key + * @param string|null $table The table + * + * @return bool + * @since 2.0.1 + */ + protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool + { + // check values + if (StringHelper::check($value) || ArrayHelper::check($value, true) || ObjectHelper::check($value) || is_numeric($value)) + { + return true; + } + // remove empty values + return false; + } + + /** + * Get the current active table + * + * @return string + * @since 2.0.1 + */ + protected function getTable(): string + { + return $this->config->table_name; + } +} + diff --git a/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.power b/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.power new file mode 100644 index 0000000..a338265 --- /dev/null +++ b/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/code.power @@ -0,0 +1,109 @@ + /** + * GetBible Config + * + * @var Config + * @since 2.0.1 + */ + protected Config $config; + + /** + * Constructor + * + * @param Config $config The getBible config object. + * @param Table $table The getBible table object. + * + * @since 2.0.1 + */ + public function __construct(Config $config, Table $table) + { + parent::__construct($table); + + $this->config = $config; + } + + /** + * Model the value + * Example: $this->value(value, 'field_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 2.0.1 + */ + public function value($value, string $field, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->getTable(); + } + + // check if this is a valid table + if (($store = $this->table->get($table, $field, 'store')) !== null) + { + // open the value based on the store method + switch($store) + { + case 'json': + $value = json_decode($value); + break; + } + } + + return $value; + } + + /** + * Validate before the value is modelled + * + * @param mixed $value The field value + * @param string|null $field The field key + * @param string|null $table The table + * + * @return bool + * @since 2.0.1 + */ + protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool + { + // only strings or numbers allowed + if (StringHelper::check($value) || is_numeric($value)) + { + return true; + } + // remove empty values + return false; + } + + /** + * Validate after the value is modelled + * + * @param mixed $value The field value + * @param string|null $field The field key + * @param string|null $table The table + * + * @return bool + * @since 2.0.1 + */ + protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool + { + // check values + if (StringHelper::check($value) || ArrayHelper::check($value, true) || ObjectHelper::check($value) || is_numeric($value)) + { + return true; + } + // remove empty values + return false; + } + + /** + * Get the current active table + * + * @return string + * @since 2.0.1 + */ + protected function getTable(): string + { + return $this->config->table_name; + } \ No newline at end of file diff --git a/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/settings.json b/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/settings.json new file mode 100644 index 0000000..826c707 --- /dev/null +++ b/src/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0/settings.json @@ -0,0 +1,41 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "584747d1-3a86-453d-b7a3-a2219de8d777", + "guid": "b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0", + "implements": [ + "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff" + ], + "load_selection": null, + "name": "Load", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Model.Load", + "type": "final class", + "use_selection": { + "use_selection3": { + "use": "71075f03-4e77-4fc0-840a-ef55fd9260b2", + "as": "default" + }, + "use_selection4": { + "use": "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068", + "as": "default" + }, + "use_selection0": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection1": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection2": { + "use": "91004529-94a9-4590-b842-e7c6b624ecf5", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Model.Load", + "description": "The GetBible Model to Load\r\n\r\n@since 2.0.1", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/b32eea04-6b9c-469d-94db-35d610686cf1/README.md b/src/b32eea04-6b9c-469d-94db-35d610686cf1/README.md index b1d65e2..9590f0b 100644 --- a/src/b32eea04-6b9c-469d-94db-35d610686cf1/README.md +++ b/src/b32eea04-6b9c-469d-94db-35d610686cf1/README.md @@ -21,7 +21,7 @@ class Api #Gold { note right of Api::register Registers the service provider with a DI container. - since: 3.2.0 + since: 2.0.1 return: void end note diff --git a/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php b/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php index 7df8fe2..b08eb75 100644 --- a/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php +++ b/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.php @@ -23,7 +23,7 @@ use VDM\Joomla\GetBible\Api\Verses; /** * The GetBible Api Service * - * @since 3.2.0 + * @since 2.0.1 */ class Api implements ServiceProviderInterface { @@ -33,7 +33,7 @@ class Api implements ServiceProviderInterface * @param Container $container The DI container. * * @return void - * @since 3.2.0 + * @since 2.0.1 */ public function register(Container $container) { diff --git a/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.power b/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.power index 3ee348c..1dfb81e 100644 --- a/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.power +++ b/src/b32eea04-6b9c-469d-94db-35d610686cf1/code.power @@ -4,7 +4,7 @@ * @param Container $container The DI container. * * @return void - * @since 3.2.0 + * @since 2.0.1 */ public function register(Container $container) { diff --git a/src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json b/src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json index 4d50170..5343885 100644 --- a/src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json +++ b/src/b32eea04-6b9c-469d-94db-35d610686cf1/settings.json @@ -12,25 +12,25 @@ "system_name": "Joomla.GetBible.Service.Api", "type": "class", "use_selection": { - "use_selection1": { + "use_selection0": { "use": "be0cae8b-4b78-4f59-b97b-9e31ee6f52e0", "as": "default" }, - "use_selection2": { + "use_selection1": { "use": "491c91ce-6355-40d3-bbbd-622473c6c026", "as": "default" }, - "use_selection3": { + "use_selection2": { "use": "a752e4b2-9b5e-4188-8d33-3799c46d5119", "as": "default" }, - "use_selection4": { + "use_selection3": { "use": "afa508bf-78f8-4616-97cc-f2809584c086", "as": "default" } }, "namespace": "VDM\\Joomla\\GetBible\\Service.Api", - "description": "The GetBible Api Service\r\n\r\n@since 3.2.0", + "description": "The GetBible Api Service\r\n\r\n@since 2.0.1", "implements_custom": "ServiceProviderInterface", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", diff --git a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/README.md b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/README.md index 9c24b3f..8f97030 100644 --- a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/README.md +++ b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/README.md @@ -17,7 +17,7 @@ class Http << (F,LightGreen) >> #Green { note right of Http::__construct Constructor. - since: 3.2.0 + since: 2.0.1 end note @enduml diff --git a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php index ec581fb..52c3cd4 100644 --- a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php +++ b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.php @@ -19,14 +19,14 @@ use Joomla\Registry\Registry; /** * The GetBible Http * - * @since 3.2.0 + * @since 2.0.1 */ final class Http extends JoomlaHttp { /** * Constructor. * - * @since 3.2.0 + * @since 2.0.1 * @throws \InvalidArgumentException **/ public function __construct() diff --git a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.power b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.power index 0e3f76f..d53a742 100644 --- a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.power +++ b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/code.power @@ -1,7 +1,7 @@ /** * Constructor. * - * @since 3.2.0 + * @since 2.0.1 * @throws \InvalidArgumentException **/ public function __construct() diff --git a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json index 71808ca..c40260d 100644 --- a/src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json +++ b/src/b8c66089-735e-4081-825c-8fe36b28e4a6/settings.json @@ -11,7 +11,7 @@ "type": "final class", "use_selection": null, "namespace": "VDM\\Joomla\\GetBible\\Utilities.Http", - "description": "The GetBible Http\r\n\r\n@since 3.2.0", + "description": "The GetBible Http\r\n\r\n@since 2.0.1", "extends_custom": "JoomlaHttp", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "use Joomla\\CMS\\Http\\Http as JoomlaHttp;\r\nuse Joomla\\Registry\\Registry;", diff --git a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/README.md b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/README.md index f5e8471..baaeced 100644 --- a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/README.md +++ b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/README.md @@ -13,21 +13,29 @@ class Translations << (F,LightGreen) >> #Green { + list() : ?object + checksum() : ?object + + sha(string $translation = 'kjv') : ?string } note right of Translations::list List the translations - since: 3.2.0 + since: 2.0.1 return: ?object end note note right of Translations::checksum List the translations checksums - since: 3.2.0 + since: 2.0.1 return: ?object end note + +note right of Translations::sha + Get the translation's checksums + + since: 2.0.1 + return: ?string +end note @enduml ``` diff --git a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php index 02bb5da..4ff0648 100644 --- a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php +++ b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.php @@ -18,7 +18,7 @@ use VDM\Joomla\GetBible\Abstraction\Api; /** * The GetBible Translations * - * @since 3.2.0 + * @since 2.0.1 */ final class Translations extends Api { @@ -26,7 +26,7 @@ final class Translations extends Api * List the translations * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function list(): ?object { @@ -41,7 +41,7 @@ final class Translations extends Api * List the translations checksums * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function checksum(): ?object { @@ -50,6 +50,25 @@ final class Translations extends Api $this->uri->get('checksum.json') ) ); + } + + /** + * Get the translation's checksums + * + * @param string $translation The translation. + * + * @return string|null The response checksum or null if an error occurs. + * @since 2.0.1 + */ + public function sha(string $translation = 'kjv'): ?string + { + return trim( + $this->response->get( + $this->http->get( + $this->uri->get($translation . '.sha') + ) + ) + ); } } diff --git a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.power b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.power index 1f28144..8f48ac1 100644 --- a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.power +++ b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/code.power @@ -2,7 +2,7 @@ * List the translations * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function list(): ?object { @@ -17,7 +17,7 @@ * List the translations checksums * * @return object|null The response object or null if an error occurs. - * @since 3.2.0 + * @since 2.0.1 */ public function checksum(): ?object { @@ -26,4 +26,23 @@ $this->uri->get('checksum.json') ) ); + } + + /** + * Get the translation's checksums + * + * @param string $translation The translation. + * + * @return string|null The response checksum or null if an error occurs. + * @since 2.0.1 + */ + public function sha(string $translation = 'kjv'): ?string + { + return trim( + $this->response->get( + $this->http->get( + $this->uri->get($translation . '.sha') + ) + ) + ); } \ No newline at end of file diff --git a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json index f41b4d3..41e09cc 100644 --- a/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json +++ b/src/be0cae8b-4b78-4f59-b97b-9e31ee6f52e0/settings.json @@ -11,7 +11,7 @@ "type": "final class", "use_selection": null, "namespace": "VDM\\Joomla\\GetBible\\Api.Translations", - "description": "The GetBible Translations\r\n\r\n@since 3.2.0", + "description": "The GetBible Translations\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/c03b9c61-17d3-4774-a335-783903719f83/README.md b/src/c03b9c61-17d3-4774-a335-783903719f83/README.md new file mode 100644 index 0000000..e5fe068 --- /dev/null +++ b/src/c03b9c61-17d3-4774-a335-783903719f83/README.md @@ -0,0 +1,76 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Load (Details) +> namespace: **VDM\Joomla\GetBible\Database** +```uml +@startuml +class Load << (F,LightGreen) >> #Green { + # Table $table + # Model $model + # Database $load + + __construct(Table $table, Model $model, ...) + + value(int $id, string $field, ...) : mixed + + item(int $id, ?string $table) : ?object + + items(array $ids, string $table) : ?array +} + +note right of Load::__construct + Constructor + + since: 2.0.1 + + arguments: + Table $table + Model $model + Database $load +end note + +note right of Load::value + Get a value from a given table +Example: $this->value(23, 'value_key', 'table_name'); + + since: 2.0.1 + return: mixed + + arguments: + int $id + string $field + string $table +end note + +note right of Load::item + Get values from a given table +Example: $this->item(23, 'table_name'); + + since: 2.0.1 + return: ?object +end note + +note right of Load::items + Get values from a given table +Example: $this->items($ids, 'table_name'); + + since: 2.0.1 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/c03b9c61-17d3-4774-a335-783903719f83/code.php b/src/c03b9c61-17d3-4774-a335-783903719f83/code.php new file mode 100644 index 0000000..6edefb0 --- /dev/null +++ b/src/c03b9c61-17d3-4774-a335-783903719f83/code.php @@ -0,0 +1,147 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Database; + + +use VDM\Joomla\GetBible\Table; +use VDM\Joomla\GetBible\Model\Load as Model; +use VDM\Joomla\Database\Load as Database; + + +/** + * GetBible Database Load + * + * @since 2.0.1 + */ +final class Load +{ + /** + * Search Table + * + * @var Table + * @since 2.0.1 + */ + protected Table $table; + + /** + * Model Load + * + * @var Model + * @since 2.0.1 + */ + protected Model $model; + + /** + * Database Load + * + * @var Database + * @since 2.0.1 + */ + protected Database $load; + + /** + * Constructor + * + * @param Table $table The core table object. + * @param Model $model The model object. + * @param Database $load The database object. + * + * @since 2.0.1 + */ + public function __construct(Table $table, Model $model, Database $load) + { + $this->table = $table; + $this->model = $model; + $this->load = $load; + } + + /** + * Get a value from a given table + * Example: $this->value(23, 'value_key', 'table_name'); + * + * @param int $id The item ID + * @param string $field The field key + * @param string $table The table + * + * @return mixed + * @since 2.0.1 + */ + public function value(int $id, string $field, string $table) + { + // check if this is a valid table + if ($id > 0 && $this->table->exist($table, $field)) + { + return $this->model->value( + $this->load->value( + ["a.${field}" => $field], ['a' => $table], ['a.id' => $id] + ), + $field, + $table + ); + } + + return null; + } + + /** + * Get values from a given table + * Example: $this->item(23, 'table_name'); + * + * @param int $id The item ID + * @param string $table The table + * + * @return object|null + * @since 2.0.1 + */ + public function item(int $id, ?string $table): ?object + { + // check if this is a valid table + if ($id > 0 && $this->table->exist($table)) + { + return $this->model->item( + $this->load->item( + ['all' => 'a.*'], ['a' => $table], ['a.id' => $id] + ), + $table + ); + } + + return null; + } + + /** + * Get values from a given table + * Example: $this->items($ids, 'table_name'); + * + * @param array $ids The item ids + * @param string $table The table + * + * @return array|null + * @since 2.0.1 + */ + public function items(array $ids, string $table): ?array + { + // check if this is a valid table + if ($this->table->exist($table)) + { + return $this->model->items( + $this->load->items( + ['all' => 'a.*'], ['a' => $table], ['a.id' => $ids] + ), + $table + ); + } + + return null; + } +} + diff --git a/src/c03b9c61-17d3-4774-a335-783903719f83/code.power b/src/c03b9c61-17d3-4774-a335-783903719f83/code.power new file mode 100644 index 0000000..1622ead --- /dev/null +++ b/src/c03b9c61-17d3-4774-a335-783903719f83/code.power @@ -0,0 +1,119 @@ + /** + * Search Table + * + * @var Table + * @since 2.0.1 + */ + protected Table $table; + + /** + * Model Load + * + * @var Model + * @since 2.0.1 + */ + protected Model $model; + + /** + * Database Load + * + * @var Database + * @since 2.0.1 + */ + protected Database $load; + + /** + * Constructor + * + * @param Table $table The core table object. + * @param Model $model The model object. + * @param Database $load The database object. + * + * @since 2.0.1 + */ + public function __construct(Table $table, Model $model, Database $load) + { + $this->table = $table; + $this->model = $model; + $this->load = $load; + } + + /** + * Get a value from a given table + * Example: $this->value(23, 'value_key', 'table_name'); + * + * @param int $id The item ID + * @param string $field The field key + * @param string $table The table + * + * @return mixed + * @since 2.0.1 + */ + public function value(int $id, string $field, string $table) + { + // check if this is a valid table + if ($id > 0 && $this->table->exist($table, $field)) + { + return $this->model->value( + $this->load->value( + ["a.${field}" => $field], ['a' => $table], ['a.id' => $id] + ), + $field, + $table + ); + } + + return null; + } + + /** + * Get values from a given table + * Example: $this->item(23, 'table_name'); + * + * @param int $id The item ID + * @param string $table The table + * + * @return object|null + * @since 2.0.1 + */ + public function item(int $id, ?string $table): ?object + { + // check if this is a valid table + if ($id > 0 && $this->table->exist($table)) + { + return $this->model->item( + $this->load->item( + ['all' => 'a.*'], ['a' => $table], ['a.id' => $id] + ), + $table + ); + } + + return null; + } + + /** + * Get values from a given table + * Example: $this->items($ids, 'table_name'); + * + * @param array $ids The item ids + * @param string $table The table + * + * @return array|null + * @since 2.0.1 + */ + public function items(array $ids, string $table): ?array + { + // check if this is a valid table + if ($this->table->exist($table)) + { + return $this->model->items( + $this->load->items( + ['all' => 'a.*'], ['a' => $table], ['a.id' => $ids] + ), + $table + ); + } + + return null; + } \ No newline at end of file diff --git a/src/c03b9c61-17d3-4774-a335-783903719f83/settings.json b/src/c03b9c61-17d3-4774-a335-783903719f83/settings.json new file mode 100644 index 0000000..b72cd32 --- /dev/null +++ b/src/c03b9c61-17d3-4774-a335-783903719f83/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "c03b9c61-17d3-4774-a335-783903719f83", + "implements": null, + "load_selection": null, + "name": "Load", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Database.Load", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068", + "as": "default" + }, + "use_selection1": { + "use": "b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0", + "as": "Model" + }, + "use_selection2": { + "use": "06f8eada-d59b-441c-b287-0aea1793da5a", + "as": "Database" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Database.Load", + "description": "GetBible Database Load\r\n\r\n@since 2.0.1", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/README.md b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/README.md index 63f83e0..767903b 100644 --- a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/README.md +++ b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/README.md @@ -19,7 +19,7 @@ class Response << (F,LightGreen) >> #Green { note right of Response::get Process the response and decode it. - since: 3.2.0 + since: 2.0.1 return: mixed arguments: @@ -31,14 +31,14 @@ end note note right of Response::getBody Return the body from the response - since: 3.2.0 + since: 2.0.1 return: mixed end note note right of Response::error Get the error message from the GetBible API response - since: 3.2.0 + since: 2.0.1 return: string end note diff --git a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php index 69a0e87..4264c8a 100644 --- a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php +++ b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.php @@ -20,7 +20,7 @@ use VDM\Joomla\Utilities\StringHelper; /** * The GetBible Response * - * @since 3.2.0 + * @since 2.0.1 */ final class Response { @@ -33,7 +33,7 @@ final class Response * * @return mixed * - * @since 3.2.0 + * @since 2.0.1 * @throws \DomainException **/ public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null) @@ -58,7 +58,7 @@ final class Response * @param mixed $default The default if body not have length * * @return mixed - * @since 3.2.0 + * @since 2.0.1 **/ protected function getBody(JoomlaResponse $response, $default = null) { @@ -92,7 +92,7 @@ final class Response * @param JoomlaResponse $response The response. * * @return string - * @since 3.2.0 + * @since 2.0.1 **/ protected function error(JoomlaResponse $response): string { diff --git a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.power b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.power index f6513ab..f29c159 100644 --- a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.power +++ b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/code.power @@ -7,7 +7,7 @@ * * @return mixed * - * @since 3.2.0 + * @since 2.0.1 * @throws \DomainException **/ public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null) @@ -32,7 +32,7 @@ * @param mixed $default The default if body not have length * * @return mixed - * @since 3.2.0 + * @since 2.0.1 **/ protected function getBody(JoomlaResponse $response, $default = null) { @@ -66,7 +66,7 @@ * @param JoomlaResponse $response The response. * * @return string - * @since 3.2.0 + * @since 2.0.1 **/ protected function error(JoomlaResponse $response): string { diff --git a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json index 8af5228..84f3cad 100644 --- a/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json +++ b/src/c99e85a0-d120-4f25-bcbf-0940dd7b773b/settings.json @@ -20,7 +20,7 @@ } }, "namespace": "VDM\\Joomla\\GetBible\\Utilities.Response", - "description": "The GetBible Response\r\n\r\n@since 3.2.0", + "description": "The GetBible Response\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "use Joomla\\CMS\\Http\\Response as JoomlaResponse;", "composer": "" diff --git a/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/README.md b/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/README.md new file mode 100644 index 0000000..1627ff4 --- /dev/null +++ b/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/README.md @@ -0,0 +1,89 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Update (Details) +> namespace: **VDM\Joomla\GetBible\Database** +```uml +@startuml +class Update << (F,LightGreen) >> #Green { + # Model $model + # Database $database + + __construct(Model $model, Database $database) + + value(mixed $value, string $field, ...) : bool + + row(array $item) : bool + + rows(?array $items) : bool + + item(object $item) : bool + + items(?array $items) : bool +} + +note right of Update::__construct + Constructor + + since: 2.0.1 +end note + +note right of Update::value + Update a value to a given table +Example: $this->value(Value, 'value_key', 'GUID'); + + since: 2.0.1 + return: bool + + arguments: + mixed $value + string $field + string $keyValue + string $key = 'guid' +end note + +note right of Update::row + Update single row with multiple values to a given table +Example: $this->item(Array); + + since: 2.0.1 + return: bool +end note + +note right of Update::rows + Update multiple rows to a given table +Example: $this->items(Array); + + since: 2.0.1 + return: bool +end note + +note right of Update::item + Update single item with multiple values to a given table +Example: $this->item(Object); + + since: 2.0.1 + return: bool +end note + +note right of Update::items + Update multiple items to a given table +Example: $this->items(Array); + + since: 2.0.1 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.php b/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.php new file mode 100644 index 0000000..1fe49da --- /dev/null +++ b/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.php @@ -0,0 +1,159 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible\Database; + + +use VDM\Joomla\GetBible\Model\Upsert as Model; +use VDM\Joomla\Database\Update as Database; + + +/** + * The GetBible Database Update + * + * @since 2.0.1 + */ +final class Update +{ + /** + * Model + * + * @var Model + * @since 2.0.1 + */ + protected Model $model; + + /** + * Database + * + * @var Database + * @since 2.0.1 + */ + protected Database $database; + + /** + * Constructor + * + * @param Model $model The set model object. + * @param Database $database The update database object. + * + * @since 2.0.1 + */ + public function __construct(Model $model, Database $database) + { + $this->model = $model; + $this->database = $database; + } + + /** + * Update a value to a given table + * Example: $this->value(Value, 'value_key', 'GUID'); + * + * @param mixed $value The field value + * @param string $field The field key + * @param string $keyValue The key value + * @param string $key The key name + * + * @return bool + * @since 2.0.1 + */ + public function value($value, string $field, string $keyValue, string $key = 'guid'): bool + { + // build the array + $item = []; + $item[$key] = $keyValue; + $item[$field] = $value; + + // Update the column of this table using guid as the primary key. + return $this->row($item); + } + + /** + * Update single row with multiple values to a given table + * Example: $this->item(Array); + * + * @param array $item The item to save + * + * @return bool + * @since 2.0.1 + */ + public function row(array $item): bool + { + // check if object could be modelled + if (($item = $this->model->row($item, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->row($item, 'guid', 'power'); + } + return false; + } + + /** + * Update multiple rows to a given table + * Example: $this->items(Array); + * + * @param array|null $items The items updated in database (array of arrays) + * + * @return bool + * @since 2.0.1 + */ + public function rows(?array $items): bool + { + // check if object could be modelled + if (($items = $this->model->rows($items, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->rows($items, 'guid', 'power'); + } + return false; + } + + /** + * Update single item with multiple values to a given table + * Example: $this->item(Object); + * + * @param object $item The item to save + * + * @return bool + * @since 2.0.1 + */ + public function item(object $item): bool + { + // check if object could be modelled + if (($item = $this->model->item($item, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->item($item, 'guid', 'power'); + } + return false; + } + + /** + * Update multiple items to a given table + * Example: $this->items(Array); + * + * @param array|null $items The items updated in database (array of objects) + * + * @return bool + * @since 2.0.1 + */ + public function items(?array $items): bool + { + // check if object could be modelled + if (($items = $this->model->items($items, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->items($items, 'guid', 'power'); + } + return false; + } +} + diff --git a/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.power b/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.power new file mode 100644 index 0000000..ce7cb37 --- /dev/null +++ b/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/code.power @@ -0,0 +1,132 @@ + /** + * Model + * + * @var Model + * @since 2.0.1 + */ + protected Model $model; + + /** + * Database + * + * @var Database + * @since 2.0.1 + */ + protected Database $database; + + /** + * Constructor + * + * @param Model $model The set model object. + * @param Database $database The update database object. + * + * @since 2.0.1 + */ + public function __construct(Model $model, Database $database) + { + $this->model = $model; + $this->database = $database; + } + + /** + * Update a value to a given table + * Example: $this->value(Value, 'value_key', 'GUID'); + * + * @param mixed $value The field value + * @param string $field The field key + * @param string $keyValue The key value + * @param string $key The key name + * + * @return bool + * @since 2.0.1 + */ + public function value($value, string $field, string $keyValue, string $key = 'guid'): bool + { + // build the array + $item = []; + $item[$key] = $keyValue; + $item[$field] = $value; + + // Update the column of this table using guid as the primary key. + return $this->row($item); + } + + /** + * Update single row with multiple values to a given table + * Example: $this->item(Array); + * + * @param array $item The item to save + * + * @return bool + * @since 2.0.1 + */ + public function row(array $item): bool + { + // check if object could be modelled + if (($item = $this->model->row($item, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->row($item, 'guid', 'power'); + } + return false; + } + + /** + * Update multiple rows to a given table + * Example: $this->items(Array); + * + * @param array|null $items The items updated in database (array of arrays) + * + * @return bool + * @since 2.0.1 + */ + public function rows(?array $items): bool + { + // check if object could be modelled + if (($items = $this->model->rows($items, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->rows($items, 'guid', 'power'); + } + return false; + } + + /** + * Update single item with multiple values to a given table + * Example: $this->item(Object); + * + * @param object $item The item to save + * + * @return bool + * @since 2.0.1 + */ + public function item(object $item): bool + { + // check if object could be modelled + if (($item = $this->model->item($item, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->item($item, 'guid', 'power'); + } + return false; + } + + /** + * Update multiple items to a given table + * Example: $this->items(Array); + * + * @param array|null $items The items updated in database (array of objects) + * + * @return bool + * @since 2.0.1 + */ + public function items(?array $items): bool + { + // check if object could be modelled + if (($items = $this->model->items($items, 'power')) !== null) + { + // Update the column of this table using guid as the primary key. + return $this->database->items($items, 'guid', 'power'); + } + return false; + } \ No newline at end of file diff --git a/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/settings.json b/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/settings.json new file mode 100644 index 0000000..97ffa2d --- /dev/null +++ b/src/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e/settings.json @@ -0,0 +1,27 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e", + "implements": null, + "load_selection": null, + "name": "Update", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Database.Update", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "91b37bd7-b314-48be-91cf-434ec823bd80", + "as": "Model" + }, + "use_selection1": { + "use": "cce56585-58b0-4f72-a92c-e2635ea52d83", + "as": "Database" + } + }, + "namespace": "VDM\\Joomla\\GetBible\\Database.Update", + "description": "The GetBible Database Update\r\n\r\n@since 2.0.1", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/f815fb33-f721-48a5-a84e-53f1986e8881/README.md b/src/f815fb33-f721-48a5-a84e-53f1986e8881/README.md new file mode 100644 index 0000000..d8da23e --- /dev/null +++ b/src/f815fb33-f721-48a5-a84e-53f1986e8881/README.md @@ -0,0 +1,42 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Watcher (Details) +> namespace: **VDM\Joomla\GetBible** +```uml +@startuml +class Watcher << (F,LightGreen) >> #Green { + + get(int $chapter, int $book, ...) : ?object +} + +note right of Watcher::get + Get the verses of chapter in a book in a translation + + since: 3.2.0 + return: ?object + + arguments: + int $chapter + int $book + string $translation = 'kjv' +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php b/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php new file mode 100644 index 0000000..54da0ab --- /dev/null +++ b/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.php @@ -0,0 +1,44 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible; + + +use VDM\Joomla\GetBible\Abstraction\Api; + + +/** + * The GetBible Watcher + * + * @since 3.2.0 + */ +final class Watcher extends Api +{ + /** + * Get the verses of chapter in a book in a translation + * + * @param int $chapter The chapter number. + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function get(int $chapter, int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/' . $chapter . '.json') + ) + ); + } +} + diff --git a/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.power b/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.power new file mode 100644 index 0000000..0fe8f65 --- /dev/null +++ b/src/f815fb33-f721-48a5-a84e-53f1986e8881/code.power @@ -0,0 +1,18 @@ + /** + * Get the verses of chapter in a book in a translation + * + * @param int $chapter The chapter number. + * @param int $book The book number. + * @param string $translation The translation. + * + * @return object|null The response object or null if an error occurs. + * @since 3.2.0 + */ + public function get(int $chapter, int $book, string $translation = 'kjv'): ?object + { + return $this->response->get( + $this->http->get( + $this->uri->get($translation . '/' . $book . '/' . $chapter . '.json') + ) + ); + } \ No newline at end of file diff --git a/src/f815fb33-f721-48a5-a84e-53f1986e8881/settings.json b/src/f815fb33-f721-48a5-a84e-53f1986e8881/settings.json new file mode 100644 index 0000000..2a57e70 --- /dev/null +++ b/src/f815fb33-f721-48a5-a84e-53f1986e8881/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "7b490e63-8d1f-46de-a0c4-154272fd5d7f", + "guid": "f815fb33-f721-48a5-a84e-53f1986e8881", + "implements": null, + "load_selection": null, + "name": "Watcher", + "power_version": "1.0.0", + "system_name": "Joomla.GetBible.Watcher", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Watcher", + "description": "The GetBible Watcher\r\n\r\n@since 3.2.0", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/README.md b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/README.md index 65f4979..c788465 100644 --- a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/README.md +++ b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/README.md @@ -19,13 +19,13 @@ class Uri << (F,LightGreen) >> #Green { note right of Uri::__construct Constructor - since: 3.2.0 + since: 2.0.1 end note note right of Uri::get Method to build and return a full request URL for the request. - since: 3.2.0 + since: 2.0.1 return: JoomlaUri end note diff --git a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php index 848bf47..094555e 100644 --- a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php +++ b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.php @@ -19,7 +19,7 @@ use VDM\Joomla\GetBible\Config; /** * The GetBible Uri * - * @since 3.2.0 + * @since 2.0.1 */ final class Uri { @@ -27,7 +27,7 @@ final class Uri * The Config class * * @var Config - * @since 3.2.0 + * @since 2.0.1 */ protected Config $config; @@ -36,7 +36,7 @@ final class Uri * * @param Config $config The config class. * - * @since 3.2.0 + * @since 2.0.1 **/ public function __construct(Config $config) { @@ -50,7 +50,7 @@ final class Uri * @param string $path URL to inflect * * @return JoomlaUri - * @since 3.2.0 + * @since 2.0.1 **/ public function get(string $path): JoomlaUri { diff --git a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.power b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.power index 1eb5f02..ae416f7 100644 --- a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.power +++ b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/code.power @@ -2,7 +2,7 @@ * The Config class * * @var Config - * @since 3.2.0 + * @since 2.0.1 */ protected Config $config; @@ -11,7 +11,7 @@ * * @param Config $config The config class. * - * @since 3.2.0 + * @since 2.0.1 **/ public function __construct(Config $config) { @@ -25,7 +25,7 @@ * @param string $path URL to inflect * * @return JoomlaUri - * @since 3.2.0 + * @since 2.0.1 **/ public function get(string $path): JoomlaUri { diff --git a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json index c988ff7..ce2a9a7 100644 --- a/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json +++ b/src/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb/settings.json @@ -16,7 +16,7 @@ } }, "namespace": "VDM\\Joomla\\GetBible\\Utilities.Uri", - "description": "The GetBible Uri\r\n\r\n@since 3.2.0", + "description": "The GetBible Uri\r\n\r\n@since 2.0.1", "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "use Joomla\\Uri\\Uri as JoomlaUri;", "composer": "" diff --git a/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/README.md b/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/README.md new file mode 100644 index 0000000..d09bca5 --- /dev/null +++ b/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/README.md @@ -0,0 +1,29 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Table (Details) +> namespace: **VDM\Joomla\GetBible** +```uml +@startuml +class Table #Gold { +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.php b/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.php new file mode 100644 index 0000000..0400585 --- /dev/null +++ b/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.php @@ -0,0 +1,415 @@ + + * @git GetBible + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\GetBible; + + +use VDM\Joomla\Interfaces\Tableinterface; +use VDM\Joomla\Abstraction\BaseTable; + + +/** + * GetBible Tables + * + * @since 2.0.1 + */ +class Table extends BaseTable implements Tableinterface +{ + /** + * All areas/views/tables with their field details + * + * @var array + * @since 2.0.1 + **/ + protected array $tables = [ + 'translation' => [ + 'name' => [ + 'name' => 'name', + 'label' => 'COM_GETBIBLE_TRANSLATION_NAME_LABEL', + 'type' => 'text', + 'title' => true, + 'list' => 'translations', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'abbr' => [ + 'name' => 'abbr', + 'label' => 'COM_GETBIBLE_TRANSLATION_ABBR_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'translations', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'language' => [ + 'name' => 'language', + 'label' => 'COM_GETBIBLE_TRANSLATION_LANGUAGE_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'translations', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'bidi' => [ + 'name' => 'bidi', + 'label' => 'COM_GETBIBLE_TRANSLATION_BIDI_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'translations', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'testament' => [ + 'name' => 'testament', + 'label' => 'COM_GETBIBLE_TRANSLATION_TESTAMENT_LABEL', + 'type' => 'list', + 'title' => false, + 'list' => 'translations', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'copyright' => [ + 'name' => 'copyright', + 'label' => 'COM_GETBIBLE_TRANSLATION_COPYRIGHT_LABEL', + 'type' => 'textarea', + 'title' => false, + 'list' => 'translations', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'book' => [ + 'book' => [ + 'name' => 'book', + 'label' => 'COM_GETBIBLE_BOOK_BOOK_LABEL', + 'type' => 'booknames', + 'title' => true, + 'list' => 'books', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'translation' => [ + 'name' => 'translation', + 'label' => 'COM_GETBIBLE_BOOK_TRANSLATION_LABEL', + 'type' => 'translations', + 'title' => false, + 'list' => 'books', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'scripture' => [ + 'name' => 'scripture', + 'label' => 'COM_GETBIBLE_BOOK_SCRIPTURE_LABEL', + 'type' => 'subform', + 'title' => false, + 'list' => 'books', + 'store' => 'json', + 'tab_name' => 'Details', + ], + ], + 'chapter' => [ + 'book' => [ + 'name' => 'book', + 'label' => 'COM_GETBIBLE_CHAPTER_BOOK_LABEL', + 'type' => 'booknames', + 'title' => true, + 'list' => 'chapters', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'chapter' => [ + 'name' => 'chapter', + 'label' => 'COM_GETBIBLE_CHAPTER_CHAPTER_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'chapters', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'translation' => [ + 'name' => 'translation', + 'label' => 'COM_GETBIBLE_CHAPTER_TRANSLATION_LABEL', + 'type' => 'translations', + 'title' => false, + 'list' => 'chapters', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'scripture' => [ + 'name' => 'scripture', + 'label' => 'COM_GETBIBLE_CHAPTER_SCRIPTURE_LABEL', + 'type' => 'subform', + 'title' => false, + 'list' => 'chapters', + 'store' => 'json', + 'tab_name' => 'Details', + ], + ], + 'verse' => [ + 'book' => [ + 'name' => 'book', + 'label' => 'COM_GETBIBLE_VERSE_BOOK_LABEL', + 'type' => 'booknames', + 'title' => true, + 'list' => 'verses', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'chapter' => [ + 'name' => 'chapter', + 'label' => 'COM_GETBIBLE_VERSE_CHAPTER_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'verses', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'verse' => [ + 'name' => 'verse', + 'label' => 'COM_GETBIBLE_VERSE_VERSE_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'verses', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'translation' => [ + 'name' => 'translation', + 'label' => 'COM_GETBIBLE_VERSE_TRANSLATION_LABEL', + 'type' => 'translations', + 'title' => false, + 'list' => 'verses', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'text' => [ + 'name' => 'text', + 'label' => 'COM_GETBIBLE_VERSE_TEXT_LABEL', + 'type' => 'textarea', + 'title' => false, + 'list' => 'verses', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'testament' => [ + 'name' => 'testament', + 'label' => 'COM_GETBIBLE_VERSE_TESTAMENT_LABEL', + 'type' => 'list', + 'title' => false, + 'list' => 'verses', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'book_name' => [ + 'name' => [ + 'name' => 'name', + 'label' => 'COM_GETBIBLE_BOOK_NAME_NAME_LABEL', + 'type' => 'text', + 'title' => true, + 'list' => 'book_names', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'translation' => [ + 'name' => 'translation', + 'label' => 'COM_GETBIBLE_BOOK_NAME_TRANSLATION_LABEL', + 'type' => 'translations', + 'title' => false, + 'list' => 'book_names', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'abbreviations' => [ + 'name' => 'abbreviations', + 'label' => 'COM_GETBIBLE_BOOK_NAME_ABBREVIATIONS_LABEL', + 'type' => 'subform', + 'title' => false, + 'list' => 'book_names', + 'store' => 'json', + 'tab_name' => 'Details', + ], + 'chapter' => [ + 'name' => 'chapter', + 'label' => 'COM_GETBIBLE_BOOK_NAME_CHAPTER_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'book_names', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'number' => [ + 'name' => 'number', + 'label' => 'COM_GETBIBLE_BOOK_NAME_NUMBER_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'book_names', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'highlight' => [ + 'user' => [ + 'name' => 'user', + 'label' => 'COM_GETBIBLE_HIGHLIGHT_USER_LABEL', + 'type' => 'user', + 'title' => true, + 'list' => 'highlights', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'book' => [ + 'name' => 'book', + 'label' => 'COM_GETBIBLE_HIGHLIGHT_BOOK_LABEL', + 'type' => 'booknames', + 'title' => false, + 'list' => 'highlights', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'chapter' => [ + 'name' => 'chapter', + 'label' => 'COM_GETBIBLE_HIGHLIGHT_CHAPTER_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'highlights', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'verse' => [ + 'name' => 'verse', + 'label' => 'COM_GETBIBLE_HIGHLIGHT_VERSE_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'highlights', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'colour' => [ + 'name' => 'colour', + 'label' => 'COM_GETBIBLE_HIGHLIGHT_COLOUR_LABEL', + 'type' => 'color', + 'title' => false, + 'list' => 'highlights', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'note' => [ + 'user' => [ + 'name' => 'user', + 'label' => 'COM_GETBIBLE_NOTE_USER_LABEL', + 'type' => 'user', + 'title' => true, + 'list' => 'notes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'book' => [ + 'name' => 'book', + 'label' => 'COM_GETBIBLE_NOTE_BOOK_LABEL', + 'type' => 'booknames', + 'title' => false, + 'list' => 'notes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'chapter' => [ + 'name' => 'chapter', + 'label' => 'COM_GETBIBLE_NOTE_CHAPTER_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'notes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'verse' => [ + 'name' => 'verse', + 'label' => 'COM_GETBIBLE_NOTE_VERSE_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'notes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'note' => [ + 'name' => 'note', + 'label' => 'COM_GETBIBLE_NOTE_NOTE_LABEL', + 'type' => 'textarea', + 'title' => false, + 'list' => 'notes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'taged_verse' => [ + 'title' => [ + 'name' => 'title', + 'label' => 'COM_GETBIBLE_TAGED_VERSE_TITLE_LABEL', + 'type' => 'text', + 'title' => true, + 'list' => 'taged_verses', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'alias' => [ + 'name' => 'alias', + 'label' => 'COM_GETBIBLE_TAGED_VERSE_ALIAS_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'taged_verses', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'tag' => [ + 'title' => [ + 'name' => 'title', + 'label' => 'COM_GETBIBLE_TAG_TITLE_LABEL', + 'type' => 'text', + 'title' => true, + 'list' => 'tags', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'alias' => [ + 'name' => 'alias', + 'label' => 'COM_GETBIBLE_TAG_ALIAS_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'tags', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'template' => [ + 'name' => [ + 'name' => 'name', + 'label' => 'COM_GETBIBLE_TEMPLATE_NAME_LABEL', + 'type' => 'text', + 'title' => true, + 'list' => 'templates', + 'store' => NULL, + 'tab_name' => 'Verses', + ], + 'alias' => [ + 'name' => 'alias', + 'label' => 'COM_GETBIBLE_TEMPLATE_ALIAS_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'templates', + 'store' => NULL, + 'tab_name' => 'Verses', + ], + ], + ]; +} + diff --git a/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.power b/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.power new file mode 100644 index 0000000..0dc7272 --- /dev/null +++ b/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/code.power @@ -0,0 +1,7 @@ + /** + * All areas/views/tables with their field details + * + * @var array + * @since 2.0.1 + **/ + protected array $tables = ###ALL_COMPONENT_FIELDS###; \ No newline at end of file diff --git a/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/settings.json b/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/settings.json new file mode 100644 index 0000000..a25a895 --- /dev/null +++ b/src/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "e0f6ddbe-2a35-4537-942c-faff2ebd04f6", + "guid": "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068", + "implements": [ + "2da6d6c4-eb29-4d69-8bc2-36d96e916adf" + ], + "load_selection": null, + "name": "Table", + "power_version": "2.0.0", + "system_name": "Joomla.GetBible.Table", + "type": "class", + "use_selection": null, + "namespace": "VDM\\Joomla\\GetBible\\Table", + "description": "GetBible Tables\r\n\r\n@since 2.0.1", + "licensing_template": "\/**\r\n * @package GetBible\r\n *\r\n * @created 30th May, 2023\r\n * @author Llewellyn van der Merwe \r\n * @git GetBible \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "", + "composer": "" +} \ No newline at end of file diff --git a/super-powers.json b/super-powers.json index fc7d66a..eb24c19 100644 --- a/super-powers.json +++ b/super-powers.json @@ -1,4 +1,15 @@ { + "116eb429-bc51-4d14-b9aa-7145c86a29d1": { + "name": "Model", + "type": "class", + "namespace": "VDM\\Joomla\\GetBible\\Service", + "code": "src\/116eb429-bc51-4d14-b9aa-7145c86a29d1\/code.php", + "power": "src\/116eb429-bc51-4d14-b9aa-7145c86a29d1\/code.power", + "settings": "src\/116eb429-bc51-4d14-b9aa-7145c86a29d1\/settings.json", + "path": "src\/116eb429-bc51-4d14-b9aa-7145c86a29d1", + "spk": "Super__116eb429_bc51_4d14_b9aa_7145c86a29d1__Power", + "guid": "116eb429-bc51-4d14-b9aa-7145c86a29d1" + }, "11892cfa-374e-4e3f-b0bc-531871c822d9": { "name": "Factory", "type": "abstract class", @@ -21,6 +32,17 @@ "spk": "Super__491c91ce_6355_40d3_bbbd_622473c6c026__Power", "guid": "491c91ce-6355-40d3-bbbd-622473c6c026" }, + "51bb0397-fa7c-4f7a-a4c5-1f95fdacad38": { + "name": "Database", + "type": "class", + "namespace": "VDM\\Joomla\\GetBible\\Service", + "code": "src\/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38\/code.php", + "power": "src\/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38\/code.power", + "settings": "src\/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38\/settings.json", + "path": "src\/51bb0397-fa7c-4f7a-a4c5-1f95fdacad38", + "spk": "Super__51bb0397_fa7c_4f7a_a4c5_1f95fdacad38__Power", + "guid": "51bb0397-fa7c-4f7a-a4c5-1f95fdacad38" + }, "56465044-94ed-4e00-b6db-160c67163df8": { "name": "App", "type": "class", @@ -54,6 +76,39 @@ "spk": "Super__7b490e63_8d1f_46de_a0c4_154272fd5d7f__Power", "guid": "7b490e63-8d1f-46de-a0c4-154272fd5d7f" }, + "8336e3c4-f11b-41bc-a2b1-976f99442a84": { + "name": "Search", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible", + "code": "src\/8336e3c4-f11b-41bc-a2b1-976f99442a84\/code.php", + "power": "src\/8336e3c4-f11b-41bc-a2b1-976f99442a84\/code.power", + "settings": "src\/8336e3c4-f11b-41bc-a2b1-976f99442a84\/settings.json", + "path": "src\/8336e3c4-f11b-41bc-a2b1-976f99442a84", + "spk": "Super__8336e3c4_f11b_41bc_a2b1_976f99442a84__Power", + "guid": "8336e3c4-f11b-41bc-a2b1-976f99442a84" + }, + "91b37bd7-b314-48be-91cf-434ec823bd80": { + "name": "Upsert", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Model", + "code": "src\/91b37bd7-b314-48be-91cf-434ec823bd80\/code.php", + "power": "src\/91b37bd7-b314-48be-91cf-434ec823bd80\/code.power", + "settings": "src\/91b37bd7-b314-48be-91cf-434ec823bd80\/settings.json", + "path": "src\/91b37bd7-b314-48be-91cf-434ec823bd80", + "spk": "Super__91b37bd7_b314_48be_91cf_434ec823bd80__Power", + "guid": "91b37bd7-b314-48be-91cf-434ec823bd80" + }, + "a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf": { + "name": "Insert", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Database", + "code": "src\/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf\/code.php", + "power": "src\/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf\/code.power", + "settings": "src\/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf\/settings.json", + "path": "src\/a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf", + "spk": "Super__a07d90f6_6ff2_40a1_99c1_0f2cf33c9adf__Power", + "guid": "a07d90f6-6ff2-40a1-99c1-0f2cf33c9adf" + }, "a752e4b2-9b5e-4188-8d33-3799c46d5119": { "name": "Chapters", "type": "final class", @@ -76,6 +131,17 @@ "spk": "Super__afa508bf_78f8_4616_97cc_f2809584c086__Power", "guid": "afa508bf-78f8-4616-97cc-f2809584c086" }, + "b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0": { + "name": "Load", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Model", + "code": "src\/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0\/code.php", + "power": "src\/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0\/code.power", + "settings": "src\/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0\/settings.json", + "path": "src\/b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0", + "spk": "Super__b1bd2b4f_dede_44ad_86e9_2a595a0a9ca0__Power", + "guid": "b1bd2b4f-dede-44ad-86e9-2a595a0a9ca0" + }, "b32eea04-6b9c-469d-94db-35d610686cf1": { "name": "Api", "type": "class", @@ -120,6 +186,17 @@ "spk": "Super__be0cae8b_4b78_4f59_b97b_9e31ee6f52e0__Power", "guid": "be0cae8b-4b78-4f59-b97b-9e31ee6f52e0" }, + "c03b9c61-17d3-4774-a335-783903719f83": { + "name": "Load", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Database", + "code": "src\/c03b9c61-17d3-4774-a335-783903719f83\/code.php", + "power": "src\/c03b9c61-17d3-4774-a335-783903719f83\/code.power", + "settings": "src\/c03b9c61-17d3-4774-a335-783903719f83\/settings.json", + "path": "src\/c03b9c61-17d3-4774-a335-783903719f83", + "spk": "Super__c03b9c61_17d3_4774_a335_783903719f83__Power", + "guid": "c03b9c61-17d3-4774-a335-783903719f83" + }, "c99e85a0-d120-4f25-bcbf-0940dd7b773b": { "name": "Response", "type": "final class", @@ -131,6 +208,28 @@ "spk": "Super__c99e85a0_d120_4f25_bcbf_0940dd7b773b__Power", "guid": "c99e85a0-d120-4f25-bcbf-0940dd7b773b" }, + "d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e": { + "name": "Update", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible\\Database", + "code": "src\/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e\/code.php", + "power": "src\/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e\/code.power", + "settings": "src\/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e\/settings.json", + "path": "src\/d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e", + "spk": "Super__d7a5f0c6_de60_4d31_b3e4_5d668a8f7d2e__Power", + "guid": "d7a5f0c6-de60-4d31-b3e4-5d668a8f7d2e" + }, + "f815fb33-f721-48a5-a84e-53f1986e8881": { + "name": "Watcher", + "type": "final class", + "namespace": "VDM\\Joomla\\GetBible", + "code": "src\/f815fb33-f721-48a5-a84e-53f1986e8881\/code.php", + "power": "src\/f815fb33-f721-48a5-a84e-53f1986e8881\/code.power", + "settings": "src\/f815fb33-f721-48a5-a84e-53f1986e8881\/settings.json", + "path": "src\/f815fb33-f721-48a5-a84e-53f1986e8881", + "spk": "Super__f815fb33_f721_48a5_a84e_53f1986e8881__Power", + "guid": "f815fb33-f721-48a5-a84e-53f1986e8881" + }, "fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb": { "name": "Uri", "type": "final class", @@ -141,5 +240,16 @@ "path": "src\/fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb", "spk": "Super__fc9ab6f0_c31b_4077_bb1c_2dcddd36f6bb__Power", "guid": "fc9ab6f0-c31b-4077-bb1c-2dcddd36f6bb" + }, + "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068": { + "name": "Table", + "type": "class", + "namespace": "VDM\\Joomla\\GetBible", + "code": "src\/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068\/code.php", + "power": "src\/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068\/code.power", + "settings": "src\/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068\/settings.json", + "path": "src\/ff8d5fdb-2d1f-4178-bd18-a43b8efd1068", + "spk": "Super__ff8d5fdb_2d1f_4178_bd18_a43b8efd1068__Power", + "guid": "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068" } } \ No newline at end of file