4
0

update 2023-06-02 04:47:47

This commit is contained in:
Robot 2023-06-02 04:47:47 +02:00
parent d25987f693
commit e5f5ef10d0
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
90 changed files with 3742 additions and 122 deletions

View File

@ -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)

View File

@ -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)

View File

@ -0,0 +1,77 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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')
);
}
}

View File

@ -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')
);
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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

View File

@ -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());
}
}

View File

@ -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());
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""

View File

@ -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
```

View File

@ -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')
)
)
);
}
}

View File

@ -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')
)
)
);
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""

View File

@ -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)

View File

@ -0,0 +1,149 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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')
);
}
}

View File

@ -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')
);
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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
```

View File

@ -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();
}
}

View File

@ -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();
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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;",

View File

@ -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

View File

@ -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
{

View File

@ -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
{

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""

View File

@ -20,7 +20,7 @@ abstract Api #Orange {
note right of Api::__construct
Constructor.
since: 3.2.0
since: 2.0.1
arguments:
Http $http

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -0,0 +1,21 @@
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
> Error adding class diagram
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)

View File

@ -0,0 +1,23 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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
{
}

View File

@ -0,0 +1 @@
###CODEPOWER###

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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)

View File

@ -0,0 +1,141 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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;
}
}

View File

@ -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;
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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)

View File

@ -0,0 +1,159 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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;
}
}

View File

@ -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;
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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
```

View File

@ -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')
)
)
);
}
}

View File

@ -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')
)
)
);
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""

View File

@ -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:

View File

@ -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
{

View File

@ -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
{

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""

View File

@ -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)

View File

@ -0,0 +1,141 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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;
}
}

View File

@ -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;
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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;",

View File

@ -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

View File

@ -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()

View File

@ -1,7 +1,7 @@
/**
* Constructor.
*
* @since 3.2.0
* @since 2.0.1
* @throws \InvalidArgumentException
**/
public function __construct()

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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;",

View File

@ -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
```

View File

@ -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')
)
)
);
}
}

View File

@ -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')
)
)
);
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""

View File

@ -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)

View File

@ -0,0 +1,147 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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;
}
}

View File

@ -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;
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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

View File

@ -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
{

View File

@ -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
{

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""

View File

@ -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)

View File

@ -0,0 +1,159 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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;
}
}

View File

@ -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;
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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)

View File

@ -0,0 +1,44 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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')
)
);
}
}

View File

@ -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')
)
);
}

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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

View File

@ -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
{

View File

@ -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
{

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""

View File

@ -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)

View File

@ -0,0 +1,415 @@
<?php
/**
* @package GetBible
*
* @created 30th May, 2023
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git GetBible <https://git.vdm.dev/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',
],
],
];
}

View File

@ -0,0 +1,7 @@
/**
* All areas/views/tables with their field details
*
* @var array
* @since 2.0.1
**/
protected array $tables = ###ALL_COMPONENT_FIELDS###;

View File

@ -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 <https:\/\/dev.vdm.io>\r\n * @git GetBible <https:\/\/git.vdm.dev\/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": ""
}

View File

@ -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"
}
}