From eea2fa1f1317f2175504d157e2255e109863167f Mon Sep 17 00:00:00 2001 From: aB0t Date: Sun, 23 Jun 2024 22:34:48 +0200 Subject: [PATCH] Update 2024-06-24 1:01:32 --- README.md | 7 +- .../README.md | 19 ++++- .../code.php | 27 ++++++ .../code.power | 27 ++++++ .../README.md | 23 ++++- .../code.php | 25 ++++++ .../code.power | 25 ++++++ .../README.md | 54 ++++++++++++ .../code.php | 73 ++++++++++++++++ .../code.power | 44 ++++++++++ .../settings.json | 31 +++++++ .../code.php | 35 +++----- .../code.power | 35 +++----- .../README.md | 21 ++++- .../code.php | 17 +++- .../code.power | 17 +++- .../README.md | 54 ++++++++++++ .../code.php | 83 +++++++++++++++++++ .../code.power | 44 ++++++++++ .../settings.json | 21 +++++ .../README.md | 38 ++++++--- .../code.php | 63 ++++++++++++++ .../code.power | 63 ++++++++++++++ .../README.md | 4 +- .../code.php | 2 +- .../settings.json | 2 +- .../README.md | 28 +++++-- .../code.php | 13 +++ .../code.power | 13 +++ .../code.php | 25 ++---- .../code.power | 25 ++---- .../README.md | 38 +++++++++ .../code.php | 46 ++++++++++ .../code.power | 14 ++++ .../settings.json | 38 +++++++++ .../code.php | 2 +- .../settings.json | 6 +- .../README.md | 4 +- .../code.php | 4 +- .../settings.json | 8 +- .../README.md | 13 +++ .../code.php | 16 ++++ .../code.power | 16 ++++ .../README.md | 4 +- .../code.php | 8 +- .../code.power | 4 +- .../settings.json | 2 +- .../code.php | 5 ++ .../code.power | 4 + .../settings.json | 4 + super-powers.json | 37 ++++++++- 51 files changed, 1094 insertions(+), 137 deletions(-) create mode 100644 src/19b2ba92-1655-4384-acfb-979c80de8b6d/README.md create mode 100644 src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.php create mode 100644 src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.power create mode 100644 src/19b2ba92-1655-4384-acfb-979c80de8b6d/settings.json create mode 100644 src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/README.md create mode 100644 src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.php create mode 100644 src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.power create mode 100644 src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/settings.json create mode 100644 src/9d76b8dc-3883-4755-b11c-131d19ca8a53/README.md create mode 100644 src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.php create mode 100644 src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.power create mode 100644 src/9d76b8dc-3883-4755-b11c-131d19ca8a53/settings.json diff --git a/README.md b/README.md index b6afcd4..f888b9b 100644 --- a/README.md +++ b/README.md @@ -29,19 +29,21 @@ This repository contains an index (see below) of all the approved powers within - **abstract class BaseConfig** | [Details](src/ffbd4e1f-a342-4080-ab7d-1de3741bf319) | [Code](src/ffbd4e1f-a342-4080-ab7d-1de3741bf319/code.php) | [Settings](src/ffbd4e1f-a342-4080-ab7d-1de3741bf319/settings.json) | Super__ffbd4e1f_a342_4080_ab7d_1de3741bf319__Power - **abstract class BaseTable** | [Details](src/e0f6ddbe-2a35-4537-942c-faff2ebd04f6) | [Code](src/e0f6ddbe-2a35-4537-942c-faff2ebd04f6/code.php) | [Settings](src/e0f6ddbe-2a35-4537-942c-faff2ebd04f6/settings.json) | Super__e0f6ddbe_2a35_4537_942c_faff2ebd04f6__Power - **abstract class Database** | [Details](src/6cbef8f8-4813-48e3-b05a-65e1aea95171) | [Code](src/6cbef8f8-4813-48e3-b05a-65e1aea95171/code.php) | [Settings](src/6cbef8f8-4813-48e3-b05a-65e1aea95171/settings.json) | Super__6cbef8f8_4813_48e3_b05a_65e1aea95171__Power + - **abstract class Factory** | [Details](src/2e5bf608-de5c-4b00-a20d-47c26aa350d9) | [Code](src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.php) | [Settings](src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/settings.json) | Super__2e5bf608_de5c_4b00_a20d_47c26aa350d9__Power - **abstract class Grep** | [Details](src/1401a167-0ce4-4f4a-afee-2d8b02ed339b) | [Code](src/1401a167-0ce4-4f4a-afee-2d8b02ed339b/code.php) | [Settings](src/1401a167-0ce4-4f4a-afee-2d8b02ed339b/settings.json) | Super__1401a167_0ce4_4f4a_afee_2d8b02ed339b__Power - **abstract class Model** | [Details](src/584747d1-3a86-453d-b7a3-a2219de8d777) | [Code](src/584747d1-3a86-453d-b7a3-a2219de8d777/code.php) | [Settings](src/584747d1-3a86-453d-b7a3-a2219de8d777/settings.json) | Super__584747d1_3a86_453d_b7a3_a2219de8d777__Power - **abstract class Registry** | [Details](src/7e822c03-1b20-41d1-9427-f5b8d5836af7) | [Code](src/7e822c03-1b20-41d1-9427-f5b8d5836af7/code.php) | [Settings](src/7e822c03-1b20-41d1-9427-f5b8d5836af7/settings.json) | Super__7e822c03_1b20_41d1_9427_f5b8d5836af7__Power - **abstract class Schema** | [Details](src/f3c04c28-bce4-422e-be93-7d163e4e342b) | [Code](src/f3c04c28-bce4-422e-be93-7d163e4e342b/code.php) | [Settings](src/f3c04c28-bce4-422e-be93-7d163e4e342b/settings.json) | Super__f3c04c28_bce4_422e_be93_7d163e4e342b__Power - **Namespace**: [VDM\Joomla\Componentbuilder](#vdm-joomla-componentbuilder) - - **class Table** | [Details](src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8) | [Code](src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.php) | [Settings](src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/settings.json) | Super__bfd1d6d5_56c1_4fe9_9fee_1c5910e1f5d8__Power + - **final class Table** | [Details](src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8) | [Code](src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.php) | [Settings](src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/settings.json) | Super__bfd1d6d5_56c1_4fe9_9fee_1c5910e1f5d8__Power - **Namespace**: [VDM\Joomla\Data](#vdm-joomla-data) + - **abstract class Factory** | [Details](src/9d76b8dc-3883-4755-b11c-131d19ca8a53) | [Code](src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.php) | [Settings](src/9d76b8dc-3883-4755-b11c-131d19ca8a53/settings.json) | Super__9d76b8dc_3883_4755_b11c_131d19ca8a53__Power - **final class Item** | [Details](src/9206082e-a3f7-472e-98b2-de90d06cbdcd) | [Code](src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php) | [Settings](src/9206082e-a3f7-472e-98b2-de90d06cbdcd/settings.json) | Super__9206082e_a3f7_472e_98b2_de90d06cbdcd__Power - **final class Items** | [Details](src/21bca8a4-5b28-41c4-843e-8097f0ba7cca) | [Code](src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.php) | [Settings](src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/settings.json) | Super__21bca8a4_5b28_41c4_843e_8097f0ba7cca__Power + - **final class Subform** | [Details](src/85785701-07b2-4f81-bc1e-0f423700c254) | [Code](src/85785701-07b2-4f81-bc1e-0f423700c254/code.php) | [Settings](src/85785701-07b2-4f81-bc1e-0f423700c254/settings.json) | Super__85785701_07b2_4f81_bc1e_0f423700c254__Power - **class Remote** | [Details](src/728ee726-3f0f-4762-899d-f8c9430cee58) | [Code](src/728ee726-3f0f-4762-899d-f8c9430cee58/code.php) | [Settings](src/728ee726-3f0f-4762-899d-f8c9430cee58/settings.json) | Super__728ee726_3f0f_4762_899d_f8c9430cee58__Power - - **class Subform** | [Details](src/85785701-07b2-4f81-bc1e-0f423700c254) | [Code](src/85785701-07b2-4f81-bc1e-0f423700c254/code.php) | [Settings](src/85785701-07b2-4f81-bc1e-0f423700c254/settings.json) | Super__85785701_07b2_4f81_bc1e_0f423700c254__Power - **Namespace**: [VDM\Joomla\Database](#vdm-joomla-database) - **final class Delete** | [Details](src/92291f1f-f248-4ec0-9f2a-3d47c49eeac1) | [Code](src/92291f1f-f248-4ec0-9f2a-3d47c49eeac1/code.php) | [Settings](src/92291f1f-f248-4ec0-9f2a-3d47c49eeac1/settings.json) | Super__92291f1f_f248_4ec0_9f2a_3d47c49eeac1__Power @@ -70,6 +72,7 @@ This repository contains an index (see below) of all the approved powers within - **class Data** | [Details](src/a5daf189-3345-4b13-8716-c51f686f545b) | [Code](src/a5daf189-3345-4b13-8716-c51f686f545b/code.php) | [Settings](src/a5daf189-3345-4b13-8716-c51f686f545b/settings.json) | Super__a5daf189_3345_4b13_8716_c51f686f545b__Power - **class Database** | [Details](src/4815e1c7-a433-443d-a112-d1e03d7df84b) | [Code](src/4815e1c7-a433-443d-a112-d1e03d7df84b/code.php) | [Settings](src/4815e1c7-a433-443d-a112-d1e03d7df84b/settings.json) | Super__4815e1c7_a433_443d_a112_d1e03d7df84b__Power - **class Model** | [Details](src/2dcedd6c-c95b-4a37-9cac-95d28faedca3) | [Code](src/2dcedd6c-c95b-4a37-9cac-95d28faedca3/code.php) | [Settings](src/2dcedd6c-c95b-4a37-9cac-95d28faedca3/settings.json) | Super__2dcedd6c_c95b_4a37_9cac_95d28faedca3__Power + - **class Table** | [Details](src/19b2ba92-1655-4384-acfb-979c80de8b6d) | [Code](src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.php) | [Settings](src/19b2ba92-1655-4384-acfb-979c80de8b6d/settings.json) | Super__19b2ba92_1655_4384_acfb_979c80de8b6d__Power - **Namespace**: [VDM\Joomla\Utilities](#vdm-joomla-utilities) - **abstract class ArrayHelper** | [Details](src/0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a) | [Code](src/0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a/code.php) | [Settings](src/0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a/settings.json) | Super__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a__Power diff --git a/src/008d111c-9d43-427c-8dd4-2653e8b74be8/README.md b/src/008d111c-9d43-427c-8dd4-2653e8b74be8/README.md index b754d66..cd49c68 100644 --- a/src/008d111c-9d43-427c-8dd4-2653e8b74be8/README.md +++ b/src/008d111c-9d43-427c-8dd4-2653e8b74be8/README.md @@ -18,6 +18,7 @@ class Load #Gold { + __construct(Model $model, Database $load, ...) + table(?string $table) : self + value(array $keys, string $field) : mixed + + values(array $keys, string $field) : ?array + item(array $keys) : ?object + items(array $keys) : ?array + getTable() : string @@ -35,7 +36,7 @@ note right of Load::__construct ?string $table = null end note -note right of Load::table +note left of Load::table Set the current active table since: 3.2.2 @@ -54,6 +55,18 @@ Example: $this->value( return: mixed end note +note left of Load::values + Get a value from multiple rows from a given table +Example: $this->values( +[ +'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' +], 'value_key' +); + + since: 3.2.2 + return: ?array +end note + note right of Load::item Get values from a given table Example: $this->item( @@ -66,7 +79,7 @@ Example: $this->item( return: ?object end note -note right of Load::items +note left of Load::items Get values from a given table Example: $this->items( [ @@ -89,7 +102,7 @@ note right of Load::getTable return: string end note -note right of Load::prefix +note left of Load::prefix Add prefix to the keys since: 2.0.1 diff --git a/src/008d111c-9d43-427c-8dd4-2653e8b74be8/code.php b/src/008d111c-9d43-427c-8dd4-2653e8b74be8/code.php index 6b1426c..83b481e 100644 --- a/src/008d111c-9d43-427c-8dd4-2653e8b74be8/code.php +++ b/src/008d111c-9d43-427c-8dd4-2653e8b74be8/code.php @@ -112,6 +112,33 @@ class Load implements LoadInterface ); } + /** + * Get a value from multiple rows from a given table + * Example: $this->values( + * [ + * 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + * ], 'value_key' + * ); + * + * @param array $keys The item keys + * @param string $field The field key + * + * @return array|null + * @since 3.2.2 + */ + public function values(array $keys, string $field): ?array + { + return $this->model->values( + $this->load->values( + ["a.{$field}" => $field], + ['a' => $this->getTable()], + $this->prefix($keys) + ), + $field, + $this->getTable() + ); + } + /** * Get values from a given table * Example: $this->item( diff --git a/src/008d111c-9d43-427c-8dd4-2653e8b74be8/code.power b/src/008d111c-9d43-427c-8dd4-2653e8b74be8/code.power index f883d08..a368061 100644 --- a/src/008d111c-9d43-427c-8dd4-2653e8b74be8/code.power +++ b/src/008d111c-9d43-427c-8dd4-2653e8b74be8/code.power @@ -86,6 +86,33 @@ ); } + /** + * Get a value from multiple rows from a given table + * Example: $this->values( + * [ + * 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + * ], 'value_key' + * ); + * + * @param array $keys The item keys + * @param string $field The field key + * + * @return array|null + * @since 3.2.2 + */ + public function values(array $keys, string $field): ?array + { + return $this->model->values( + $this->load->values( + ["a.{$field}" => $field], + ['a' => $this->getTable()], + $this->prefix($keys) + ), + $field, + $this->getTable() + ); + } + /** * Get values from a given table * Example: $this->item( diff --git a/src/06f8eada-d59b-441c-b287-0aea1793da5a/README.md b/src/06f8eada-d59b-441c-b287-0aea1793da5a/README.md index 8a30aa4..2d96f8a 100644 --- a/src/06f8eada-d59b-441c-b287-0aea1793da5a/README.md +++ b/src/06f8eada-d59b-441c-b287-0aea1793da5a/README.md @@ -19,6 +19,7 @@ class Load << (F,LightGreen) >> #RoyalBlue { + max(string $field, array $tables, ...) : ?int + count(array $tables, array $filter) : ?int + value(array $select, array $tables, ...) : mixed + + values(array $select, array $tables, ...) : ?array # many(array $select, array $tables, ...) : bool # one(array $select, array $tables, ...) : bool # query(array $select, array $tables, ...) : ?object @@ -111,7 +112,21 @@ note right of Load::value ?array $order = null end note -note left of Load::many +note left of Load::values + Load values from multiple rows + + since: 3.2.2 + return: ?array + + arguments: + array $select + array $tables + ?array $where = null + ?array $order = null + ?int $limit = null +end note + +note right of Load::many Load many since: 3.2.0 @@ -125,7 +140,7 @@ note left of Load::many ?int $limit = null end note -note right of Load::one +note left of Load::one Load one since: 3.2.0 @@ -138,7 +153,7 @@ note right of Load::one ?array $order = null end note -note left of Load::query +note right of Load::query Get the query object since: 3.2.0 @@ -152,7 +167,7 @@ note left of Load::query ?int $limit = null end note -note right of Load::getKey +note left of Load::getKey Get the key from the selection array. This function retrieves a key from the provided selection array. The key is removed from the array after being retrieved. diff --git a/src/06f8eada-d59b-441c-b287-0aea1793da5a/code.php b/src/06f8eada-d59b-441c-b287-0aea1793da5a/code.php index ab7b5ff..1670adc 100644 --- a/src/06f8eada-d59b-441c-b287-0aea1793da5a/code.php +++ b/src/06f8eada-d59b-441c-b287-0aea1793da5a/code.php @@ -216,6 +216,31 @@ final class Load extends Database implements LoadInterface return null; } + /** + * Load values from multiple rows + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * @param int|null $limit Limit the number of values returned + * + * @return array|null + * @since 3.2.2 + **/ + public function values(array $select, array $tables, ?array $where = null, + ?array $order = null, ?int $limit = null): ?array + { + // check if we can get many rows + if ($this->many($select, $tables, $where, $order, $limit)) + { + return $this->db->loadColumn(); + } + + // data does not exist + return null; + } + /** * Load many * diff --git a/src/06f8eada-d59b-441c-b287-0aea1793da5a/code.power b/src/06f8eada-d59b-441c-b287-0aea1793da5a/code.power index 01d3090..5ec87aa 100644 --- a/src/06f8eada-d59b-441c-b287-0aea1793da5a/code.power +++ b/src/06f8eada-d59b-441c-b287-0aea1793da5a/code.power @@ -190,6 +190,31 @@ return null; } + /** + * Load values from multiple rows + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * @param int|null $limit Limit the number of values returned + * + * @return array|null + * @since 3.2.2 + **/ + public function values(array $select, array $tables, ?array $where = null, + ?array $order = null, ?int $limit = null): ?array + { + // check if we can get many rows + if ($this->many($select, $tables, $where, $order, $limit)) + { + return $this->db->loadColumn(); + } + + // data does not exist + return null; + } + /** * Load many * diff --git a/src/19b2ba92-1655-4384-acfb-979c80de8b6d/README.md b/src/19b2ba92-1655-4384-acfb-979c80de8b6d/README.md new file mode 100644 index 0000000..0630923 --- /dev/null +++ b/src/19b2ba92-1655-4384-acfb-979c80de8b6d/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class Table (Details) +> namespace: **VDM\Joomla\Service** +> extends: **** +```uml +@startuml +class Table #Gold { + + register(Container $container) : void + + getTable(Container $container) : DataTable + + getSchema(Container $container) : Schema +} + +note right of Table::register + Registers the service provider with a DI container. + + since: 3.2.2 + return: void +end note + +note right of Table::getTable + Get The Componentbuilder Data Table Class. + + since: 3.2.2 + return: DataTable +end note + +note right of Table::getSchema + Get The Schema Class. + + since: 3.2.2 + return: Schema +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.php b/src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.php new file mode 100644 index 0000000..eaf4110 --- /dev/null +++ b/src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.php @@ -0,0 +1,73 @@ + + * @git Joomla Component Builder + * @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\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Table as DataTable; +use VDM\Joomla\Componentbuilder\Table\Schema; + + +/** + * Table Service Provider + * + * @since 3.2.2 + */ +class Table implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.2 + */ + public function register(Container $container) + { + $container->alias(DataTable::class, 'Table') + ->share('Table', [$this, 'getTable'], true); + + $container->alias(Schema::class, 'Table.Schema') + ->share('Table.Schema', [$this, 'getSchema'], true); + } + + /** + * Get The Componentbuilder Data Table Class. + * + * @param Container $container The DI container. + * + * @return DataTable + * @since 3.2.2 + */ + public function getTable(Container $container): DataTable + { + return new DataTable(); + } + + /** + * Get The Schema Class. + * + * @param Container $container The DI container. + * + * @return Schema + * @since 3.2.2 + */ + public function getSchema(Container $container): Schema + { + return new Schema( + $container->get('Table') + ); + } +} + diff --git a/src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.power b/src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.power new file mode 100644 index 0000000..6212758 --- /dev/null +++ b/src/19b2ba92-1655-4384-acfb-979c80de8b6d/code.power @@ -0,0 +1,44 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.2 + */ + public function register(Container $container) + { + $container->alias(DataTable::class, 'Table') + ->share('Table', [$this, 'getTable'], true); + + $container->alias(Schema::class, 'Table.Schema') + ->share('Table.Schema', [$this, 'getSchema'], true); + } + + /** + * Get The [[[Component]]] Data Table Class. + * + * @param Container $container The DI container. + * + * @return DataTable + * @since 3.2.2 + */ + public function getTable(Container $container): DataTable + { + return new DataTable(); + } + + /** + * Get The Schema Class. + * + * @param Container $container The DI container. + * + * @return Schema + * @since 3.2.2 + */ + public function getSchema(Container $container): Schema + { + return new Schema( + $container->get('Table') + ); + } \ No newline at end of file diff --git a/src/19b2ba92-1655-4384-acfb-979c80de8b6d/settings.json b/src/19b2ba92-1655-4384-acfb-979c80de8b6d/settings.json new file mode 100644 index 0000000..cf0ef5f --- /dev/null +++ b/src/19b2ba92-1655-4384-acfb-979c80de8b6d/settings.json @@ -0,0 +1,31 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "", + "guid": "19b2ba92-1655-4384-acfb-979c80de8b6d", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "Table", + "power_version": "1.0.0", + "system_name": "VDM.Service.Table", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8", + "as": "DataTable" + }, + "use_selection1": { + "use": "b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce", + "as": "default" + } + }, + "extendsinterfaces": null, + "namespace": "[[[NamespacePrefix]]]\\Joomla\\Service.Table", + "description": "Table Service Provider\r\n\r\n@since 3.2.2", + "implements_custom": "ServiceProviderInterface", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", + "head": "use Joomla\\DI\\Container;\r\nuse Joomla\\DI\\ServiceProviderInterface;", + "composer": "" +} \ No newline at end of file diff --git a/src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.php b/src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.php index b6fc1fb..61b0c24 100644 --- a/src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.php +++ b/src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.php @@ -142,32 +142,18 @@ final class Items implements ItemsInterface * @param string $key The key on which the values being searched. * @param string $get The key of the values we want back * - * @return array|null The array of found values. + * @return array|null The array of found values. * @since 3.2.2 */ public function values(array $values, string $key = 'guid', string $get = 'id'): ?array { // Perform the database query - $rows = $this->database->rows( - ["a.$get" => $get], - ["a" => $this->getTable()], - ["a.$key" => ['operator' => 'IN', 'value' => $values]] - ); - - // Check if rows are found - if ($rows !== null) - { - // Return the values from the found rows - return array_values( - array_map( - fn($row) => $row[$get], - $rows - ) - ); - } - - // Return null if no rows are found - return null; + return $this->load->table($this->getTable())->values([ + $key => [ + 'operator' => 'IN', + 'value' => array_values($values) + ] + ], $get); } /** @@ -269,7 +255,12 @@ final class Items implements ItemsInterface ]; // Check for existing items. - $existingItems = $this->values($values, $key, $key); + $existingItems = $this->database->values( + ["a.$key" => $key], + ["a" => $this->getTable()], + ["a.$key" => ['operator' => 'IN', 'value' => $values]] + ); + if ($existingItems !== null) { $sets['update'] = $this->extractSet($items, $existingItems, $key) ?? []; diff --git a/src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.power b/src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.power index 34e12c4..694c6a1 100644 --- a/src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.power +++ b/src/21bca8a4-5b28-41c4-843e-8097f0ba7cca/code.power @@ -113,32 +113,18 @@ * @param string $key The key on which the values being searched. * @param string $get The key of the values we want back * - * @return array|null The array of found values. + * @return array|null The array of found values. * @since 3.2.2 */ public function values(array $values, string $key = 'guid', string $get = 'id'): ?array { // Perform the database query - $rows = $this->database->rows( - ["a.$get" => $get], - ["a" => $this->getTable()], - ["a.$key" => ['operator' => 'IN', 'value' => $values]] - ); - - // Check if rows are found - if ($rows !== null) - { - // Return the values from the found rows - return array_values( - array_map( - fn($row) => $row[$get], - $rows - ) - ); - } - - // Return null if no rows are found - return null; + return $this->load->table($this->getTable())->values([ + $key => [ + 'operator' => 'IN', + 'value' => array_values($values) + ] + ], $get); } /** @@ -240,7 +226,12 @@ ]; // Check for existing items. - $existingItems = $this->values($values, $key, $key); + $existingItems = $this->database->values( + ["a.$key" => $key], + ["a" => $this->getTable()], + ["a.$key" => ['operator' => 'IN', 'value' => $values]] + ); + if ($existingItems !== null) { $sets['update'] = $this->extractSet($items, $existingItems, $key) ?? []; diff --git a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/README.md b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/README.md index bc7c33c..5aa1293 100644 --- a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/README.md +++ b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/README.md @@ -19,6 +19,7 @@ interface LoadInterface #Lavender { + max(string $field, array $tables, ...) : ?int + count(array $tables, array $filter) : ?int + value(array $select, array $tables, ...) : mixed + + values(array $select, array $tables, ...) : ?array } note right of LoadInterface::rows @@ -35,7 +36,7 @@ note right of LoadInterface::rows ?int $limit = null end note -note right of LoadInterface::items +note left of LoadInterface::items Load data rows as an array of objects since: 3.2.0 @@ -62,7 +63,7 @@ note right of LoadInterface::row ?array $order = null end note -note right of LoadInterface::item +note left of LoadInterface::item Load data row as an object since: 3.2.0 @@ -87,7 +88,7 @@ note right of LoadInterface::max array $filter end note -note right of LoadInterface::count +note left of LoadInterface::count Count the number of items based on filter result from a given table since: 3.2.0 @@ -106,6 +107,20 @@ note right of LoadInterface::value ?array $where = null ?array $order = null end note + +note left of LoadInterface::values + Load values from multiple rows + + since: 3.2.2 + return: ?array + + arguments: + array $select + array $tables + ?array $where = null + ?array $order = null + ?int $limit = null +end note @enduml ``` diff --git a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php index 31017c5..2bff03f 100644 --- a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php +++ b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.php @@ -109,6 +109,21 @@ interface LoadInterface * @return mixed * @since 3.2.0 **/ - public function value(array $select, array $tables, ?array $where = null, ?array $order = null); + public function value(array $select, array $tables, ?array $where = null, ?array $order = null); + + /** + * Load values from multiple rows + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * @param int|null $limit Limit the number of values returned + * + * @return array|null + * @since 3.2.2 + **/ + public function values(array $select, array $tables, ?array $where = null, + ?array $order = null, ?int $limit = null): ?array; } diff --git a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.power b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.power index 46ae072..a7b441e 100644 --- a/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.power +++ b/src/2ad31f74-f579-499d-b98b-c4f54fd615dd/code.power @@ -88,4 +88,19 @@ * @return mixed * @since 3.2.0 **/ - public function value(array $select, array $tables, ?array $where = null, ?array $order = null); \ No newline at end of file + public function value(array $select, array $tables, ?array $where = null, ?array $order = null); + + /** + * Load values from multiple rows + * + * @param array $select Array of selection keys + * @param array $tables Array of tables to search + * @param array|null $where Array of where key=>value match exist + * @param array|null $order Array of how to order the data + * @param int|null $limit Limit the number of values returned + * + * @return array|null + * @since 3.2.2 + **/ + public function values(array $select, array $tables, ?array $where = null, + ?array $order = null, ?int $limit = null): ?array; \ No newline at end of file diff --git a/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/README.md b/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/README.md new file mode 100644 index 0000000..68aaa77 --- /dev/null +++ b/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Factory (Details) +> namespace: **VDM\Joomla\Abstraction** +> extends: **** +```uml +@startuml +abstract Factory #Orange { + + {static} _(string $key) : Mixed + + {static} getContainer() : Container + # {abstract} {static} createContainer() : Container +} + +note right of Factory::_ + Get any class from the package container + + since: 0.0.0 + return: Mixed +end note + +note right of Factory::getContainer + Get the global package container + + since: 0.0.0 + return: Container +end note + +note right of Factory::createContainer + Create a container object + + since: 0.0.0 + return: Container +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.php b/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.php new file mode 100644 index 0000000..a3e8c3c --- /dev/null +++ b/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.php @@ -0,0 +1,83 @@ + + * @git Joomla Component Builder + * @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\Abstraction; + + +use Joomla\DI\Container; +use VDM\Joomla\Interfaces\FactoryInterface; + + +/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** + ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** + ** + ** In realms of code where purists frown, the anti-pattern wears a crown, + ** A paradox of chaos bright, where complex paths lose all its slight. + ** For in its tangled, wild embrace, lies raw creativity's face, + ** No rigid forms, no strict decree, just boundless, daring artistry. + ** In flaws, we find the freedom's key, where messy code and brilliance spree, + ** A dance of thought, unchained, unbound, in anti-pattern, beauty's found. + ** + ** Perfect Paradox and True Nature of the Anti-Pattern by ChatGPT + ** + ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** + ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** + ** + ** @since 0.0.0 + **/ +abstract class Factory implements FactoryInterface +{ + /** + * Global Package Container + * + * @var Container|null + * @since 0.0.0 + **/ + protected static ?Container $container = null; + + /** + * Get any class from the package container + * + * @param string $key The container class key + * + * @return Mixed + * @since 0.0.0 + */ + public static function _($key) + { + return static::getContainer()->get($key); + } + + /** + * Get the global package container + * + * @return Container + * @since 0.0.0 + */ + public static function getContainer(): Container + { + if (!static::$container) + { + static::$container = static::createContainer(); + } + + return static::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 0.0.0 + */ + abstract protected static function createContainer(): Container; +} + diff --git a/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.power b/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.power new file mode 100644 index 0000000..815f85c --- /dev/null +++ b/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/code.power @@ -0,0 +1,44 @@ + /** + * Global Package Container + * + * @var Container|null + * @since 0.0.0 + **/ + protected static ?Container $container = null; + + /** + * Get any class from the package container + * + * @param string $key The container class key + * + * @return Mixed + * @since 0.0.0 + */ + public static function _($key) + { + return static::getContainer()->get($key); + } + + /** + * Get the global package container + * + * @return Container + * @since 0.0.0 + */ + public static function getContainer(): Container + { + if (!static::$container) + { + static::$container = static::createContainer(); + } + + return static::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 0.0.0 + */ + abstract protected static function createContainer(): Container; \ No newline at end of file diff --git a/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/settings.json b/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/settings.json new file mode 100644 index 0000000..3b35f4a --- /dev/null +++ b/src/2e5bf608-de5c-4b00-a20d-47c26aa350d9/settings.json @@ -0,0 +1,21 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "", + "guid": "2e5bf608-de5c-4b00-a20d-47c26aa350d9", + "implements": [ + "caf33c5d-858c-4f9a-894f-ab302ec5445a" + ], + "load_selection": null, + "name": "Factory", + "power_version": "1.0.0", + "system_name": "VDM.Factory", + "type": "abstract class", + "use_selection": null, + "extendsinterfaces": null, + "namespace": "[[[NamespacePrefix]]]\\Joomla\\Abstraction.Factory", + "description": "\/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **\r\n ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **\r\n **\r\n ** In realms of code where purists frown, the anti-pattern wears a crown,\r\n ** A paradox of chaos bright, where complex paths lose all its slight.\r\n ** For in its tangled, wild embrace, lies raw creativity's face,\r\n ** No rigid forms, no strict decree, just boundless, daring artistry.\r\n ** In flaws, we find the freedom's key, where messy code and brilliance spree,\r\n ** A dance of thought, unchained, unbound, in anti-pattern, beauty's found.\r\n **\r\n ** Perfect Paradox and True Nature of the Anti-Pattern by ChatGPT\r\n **\r\n ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **\r\n ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **\r\n **\r\n ** @since 0.0.0\r\n **\/", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \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": "" +} \ No newline at end of file diff --git a/src/584747d1-3a86-453d-b7a3-a2219de8d777/README.md b/src/584747d1-3a86-453d-b7a3-a2219de8d777/README.md index f58e9f0..202d877 100644 --- a/src/584747d1-3a86-453d-b7a3-a2219de8d777/README.md +++ b/src/584747d1-3a86-453d-b7a3-a2219de8d777/README.md @@ -19,6 +19,7 @@ abstract Model #Orange { + __construct(Table $table, ?string $tableName = null, ...) + table(string $table) : self + {abstract} value(mixed $value, string $field, ...) : mixed + + values(?array $items = null, string $field, ...) : ?array + item(?object $item, ?string $table = null) : ?object + items(?array $items = null, ?string $table = null) : ?array + row(?array $item, ?string $table = null) : ?array @@ -64,7 +65,20 @@ Example: $this->value(value, 'value_key', 'table_name'); ?string $table = null end note -note left of Model::item +note left of Model::values + Model a value of multiple items +Example: $this->items(Array, 'value_key', 'table_name'); + + since: 3.2.2 + return: ?array + + arguments: + ?array $items = null + string $field + ?string $table = null +end note + +note right of Model::item Model the values of an item Example: $this->item(Object, 'table_name'); @@ -72,7 +86,7 @@ Example: $this->item(Object, 'table_name'); return: ?object end note -note right of Model::items +note left of Model::items Model the values of multiple items Example: $this->items(Array, 'table_name'); @@ -80,7 +94,7 @@ Example: $this->items(Array, 'table_name'); return: ?array end note -note left of Model::row +note right of Model::row Model the values of an row Example: $this->item(Array, 'table_name'); @@ -88,7 +102,7 @@ Example: $this->item(Array, 'table_name'); return: ?array end note -note right of Model::rows +note left of Model::rows Model the values of multiple rows Example: $this->items(Array, 'table_name'); @@ -96,7 +110,7 @@ Example: $this->items(Array, 'table_name'); return: ?array end note -note left of Model::last +note right of Model::last Get last modeled ID Example: $this->last('table_name'); @@ -104,42 +118,42 @@ Example: $this->last('table_name'); return: ?int end note -note right of Model::setTable +note left of Model::setTable Set the current active table since: 3.2.2 return: void end note -note left of Model::setAllowEmpty +note right of Model::setAllowEmpty Set the switch to control the behaviour of empty values since: 3.2.2 return: void end note -note right of Model::getTable +note left of Model::getTable Get the current active table since: 3.2.0 return: string end note -note left of Model::getAllowEmpty +note right of Model::getAllowEmpty Get the switch to control the behaviour of empty values since: 3.2.2 return: bool end note -note right of Model::getTableFields +note left of Model::getTableFields Get the current active table's fields (including defaults) since: 3.2.0 return: ?array end note -note left of Model::validateBefore +note right of Model::validateBefore Validate before the value is modelled (basic, override in child class) since: 3.2.0 @@ -151,7 +165,7 @@ note left of Model::validateBefore ?string $table = null end note -note right of Model::validateAfter +note left of Model::validateAfter Validate after the value is modelled (basic, override in child class) since: 3.2.0 diff --git a/src/584747d1-3a86-453d-b7a3-a2219de8d777/code.php b/src/584747d1-3a86-453d-b7a3-a2219de8d777/code.php index f74eba0..7a3b402 100644 --- a/src/584747d1-3a86-453d-b7a3-a2219de8d777/code.php +++ b/src/584747d1-3a86-453d-b7a3-a2219de8d777/code.php @@ -107,6 +107,69 @@ abstract class Model implements ModelInterface */ abstract public function value($value, string $field, ?string $table = null); + /** + * Model a value of multiple items + * Example: $this->items(Array, 'value_key', 'table_name'); + * + * @param array|null $items The array of values + * @param string $field The field key + * @param string|null $table The table + * + * @return array|null + * @since 3.2.2 + */ + public function values(?array $items = null, string $field, ?string $table = null): ?array + { + // check if this is a valid table + if (ArrayHelper::check($items)) + { + // set the table name + if (empty($table)) + { + $table = $this->getTable(); + } + + // validate if field exist in table + if (!$this->table->exist($table, $field)) + { + return null; + } + + // value counter + $value_number = 0; + + // check if this is a valid table + $item_bucket = []; + + foreach ($items as $value) + { + if (!$this->validateBefore($value, $field, $table)) + { + continue; + } + + $value = $this->value($value, $field, $table); + + if (!$this->validateAfter($value, $field, $table)) + { + continue; + } + + $item_bucket[] = $value; + + $value_number++; + } + + // do we have any values left + if ($value_number > 0) + { + return $item_bucket; + } + } + + return null; + } + /** * Model the values of an item * Example: $this->item(Object, 'table_name'); diff --git a/src/584747d1-3a86-453d-b7a3-a2219de8d777/code.power b/src/584747d1-3a86-453d-b7a3-a2219de8d777/code.power index b3bbf60..3b376b5 100644 --- a/src/584747d1-3a86-453d-b7a3-a2219de8d777/code.power +++ b/src/584747d1-3a86-453d-b7a3-a2219de8d777/code.power @@ -80,6 +80,69 @@ */ abstract public function value($value, string $field, ?string $table = null); + /** + * Model a value of multiple items + * Example: $this->items(Array, 'value_key', 'table_name'); + * + * @param array|null $items The array of values + * @param string $field The field key + * @param string|null $table The table + * + * @return array|null + * @since 3.2.2 + */ + public function values(?array $items = null, string $field, ?string $table = null): ?array + { + // check if this is a valid table + if (ArrayHelper::check($items)) + { + // set the table name + if (empty($table)) + { + $table = $this->getTable(); + } + + // validate if field exist in table + if (!$this->table->exist($table, $field)) + { + return null; + } + + // value counter + $value_number = 0; + + // check if this is a valid table + $item_bucket = []; + + foreach ($items as $value) + { + if (!$this->validateBefore($value, $field, $table)) + { + continue; + } + + $value = $this->value($value, $field, $table); + + if (!$this->validateAfter($value, $field, $table)) + { + continue; + } + + $item_bucket[] = $value; + + $value_number++; + } + + // do we have any values left + if ($value_number > 0) + { + return $item_bucket; + } + } + + return null; + } + /** * Model the values of an item * Example: $this->item(Object, 'table_name'); diff --git a/src/85785701-07b2-4f81-bc1e-0f423700c254/README.md b/src/85785701-07b2-4f81-bc1e-0f423700c254/README.md index a73ac45..96d6f5d 100644 --- a/src/85785701-07b2-4f81-bc1e-0f423700c254/README.md +++ b/src/85785701-07b2-4f81-bc1e-0f423700c254/README.md @@ -6,12 +6,12 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class Subform (Details) +# final class Subform (Details) > namespace: **VDM\Joomla\Data** > extends: **** ```uml @startuml -class Subform #Gold { +class Subform << (F,LightGreen) >> #RoyalBlue { # Items $items # string $table + __construct(Items $items, ?string $table = null) diff --git a/src/85785701-07b2-4f81-bc1e-0f423700c254/code.php b/src/85785701-07b2-4f81-bc1e-0f423700c254/code.php index 0568dd5..232465f 100644 --- a/src/85785701-07b2-4f81-bc1e-0f423700c254/code.php +++ b/src/85785701-07b2-4f81-bc1e-0f423700c254/code.php @@ -21,7 +21,7 @@ use VDM\Joomla\Interfaces\Data\SubformInterface; * * @since 3.2.2 */ -class Subform implements SubformInterface +final class Subform implements SubformInterface { /** * The ItemsInterface Class. diff --git a/src/85785701-07b2-4f81-bc1e-0f423700c254/settings.json b/src/85785701-07b2-4f81-bc1e-0f423700c254/settings.json index 713366e..a9a7946 100644 --- a/src/85785701-07b2-4f81-bc1e-0f423700c254/settings.json +++ b/src/85785701-07b2-4f81-bc1e-0f423700c254/settings.json @@ -10,7 +10,7 @@ "name": "Subform", "power_version": "1.0.0", "system_name": "VDM.Data.Subform", - "type": "class", + "type": "final class", "use_selection": { "use_selection0": { "use": "7212e4db-371f-4cfd-8122-32e9bb100d83", diff --git a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md index fd4cc1e..d811ec3 100644 --- a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md +++ b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md @@ -14,6 +14,7 @@ interface ModelInterface #Lavender { + table(string $table) : self + value(mixed $value, string $field, ...) : mixed + + values(?array $items = null, string $field, ...) : ?array + item(?object $item, ?string $table = null) : ?object + items(?array $items = null, ?string $table = null) : ?array + row(?array $item, ?string $table = null) : ?array @@ -43,7 +44,20 @@ Example: $this->value(value, 'value_key', 'table_name'); ?string $table = null end note -note right of ModelInterface::item +note right of ModelInterface::values + Model a value of multiple items +Example: $this->items(Array, 'value_key', 'table_name'); + + since: 3.2.0 + return: ?array + + arguments: + ?array $items = null + string $field + ?string $table = null +end note + +note left of ModelInterface::item Model the values of an item Example: $this->item(Object, 'table_name'); @@ -51,7 +65,7 @@ Example: $this->item(Object, 'table_name'); return: ?object end note -note left of ModelInterface::items +note right of ModelInterface::items Model the values of multiple items Example: $this->items(Array, 'table_name'); @@ -59,7 +73,7 @@ Example: $this->items(Array, 'table_name'); return: ?array end note -note right of ModelInterface::row +note left of ModelInterface::row Model the values of an row Example: $this->item(Array, 'table_name'); @@ -67,7 +81,7 @@ Example: $this->item(Array, 'table_name'); return: ?array end note -note left of ModelInterface::rows +note right of ModelInterface::rows Model the values of multiple rows Example: $this->items(Array, 'table_name'); @@ -75,7 +89,7 @@ Example: $this->items(Array, 'table_name'); return: ?array end note -note right of ModelInterface::last +note left of ModelInterface::last Get last modeled ID Example: $this->last('table_name'); @@ -83,14 +97,14 @@ Example: $this->last('table_name'); return: ?int end note -note left of ModelInterface::setTable +note right of ModelInterface::setTable Set the current active table since: 3.2.2 return: void end note -note right of ModelInterface::setAllowEmpty +note left of ModelInterface::setAllowEmpty Set the switch to control the behaviour of empty values since: 3.2.2 diff --git a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php index c93e80a..bb02cfa 100644 --- a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php +++ b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.php @@ -42,6 +42,19 @@ interface ModelInterface */ public function value($value, string $field, ?string $table = null); + /** + * Model a value of multiple items + * Example: $this->items(Array, 'value_key', 'table_name'); + * + * @param array|null $items The array of values + * @param string $field The field key + * @param string|null $table The table + * + * @return array|null + * @since 3.2.0 + */ + public function values(?array $items = null, string $field, ?string $table = null): ?array; + /** * Model the values of an item * Example: $this->item(Object, 'table_name'); diff --git a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.power b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.power index 1c40419..6273938 100644 --- a/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.power +++ b/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/code.power @@ -21,6 +21,19 @@ */ public function value($value, string $field, ?string $table = null); + /** + * Model a value of multiple items + * Example: $this->items(Array, 'value_key', 'table_name'); + * + * @param array|null $items The array of values + * @param string $field The field key + * @param string|null $table The table + * + * @return array|null + * @since 3.2.0 + */ + public function values(?array $items = null, string $field, ?string $table = null): ?array; + /** * Model the values of an item * Example: $this->item(Object, 'table_name'); diff --git a/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php index cae4442..4acc9fa 100644 --- a/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php +++ b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php @@ -142,22 +142,7 @@ final class Item implements ItemInterface */ public function value(string $value, string $key = 'guid', string $get = 'id') { - // Perform the database query - $value = $this->database->value( - ["a.$get" => $get], - ["a" => $this->getTable()], - ["a.$key" => $value] - ); - - // Check if rows are found - if ($value !== null) - { - // Return the value - return $value; - } - - // Return null if no rows are found - return null; + return $this->load->table($this->getTable())->value([$key => $value], $get); } /** @@ -243,7 +228,13 @@ final class Item implements ItemInterface */ private function action(string $value, string $key): string { - if (($id = $this->value($value, $key, 'id')) !== null && $id > 0) + $id = $this->database->value( + ["a.id" => 'id'], + ["a" => $this->getTable()], + ["a.$key" => $value] + ); + + if ($id !== null && $id > 0) { return 'update'; } diff --git a/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.power b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.power index fd4a94a..48ef5ea 100644 --- a/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.power +++ b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.power @@ -113,22 +113,7 @@ */ public function value(string $value, string $key = 'guid', string $get = 'id') { - // Perform the database query - $value = $this->database->value( - ["a.$get" => $get], - ["a" => $this->getTable()], - ["a.$key" => $value] - ); - - // Check if rows are found - if ($value !== null) - { - // Return the value - return $value; - } - - // Return null if no rows are found - return null; + return $this->load->table($this->getTable())->value([$key => $value], $get); } /** @@ -214,7 +199,13 @@ */ private function action(string $value, string $key): string { - if (($id = $this->value($value, $key, 'id')) !== null && $id > 0) + $id = $this->database->value( + ["a.id" => 'id'], + ["a" => $this->getTable()], + ["a.$key" => $value] + ); + + if ($id !== null && $id > 0) { return 'update'; } diff --git a/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/README.md b/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/README.md new file mode 100644 index 0000000..a3daa38 --- /dev/null +++ b/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/README.md @@ -0,0 +1,38 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Factory (Details) +> namespace: **VDM\Joomla\Data** +> extends: **ExtendingFactory** +```uml +@startuml +abstract Factory #Orange { + # {static} createContainer() : Container +} + +note right of Factory::createContainer + Create a container object + + since: 3.2.2 + return: Container +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.php b/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.php new file mode 100644 index 0000000..25bb3f8 --- /dev/null +++ b/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.php @@ -0,0 +1,46 @@ + + * @git Joomla Component Builder + * @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\Data; + + +use Joomla\DI\Container; +use VDM\Joomla\Service\Table; +use VDM\Joomla\Service\Database; +use VDM\Joomla\Service\Model; +use VDM\Joomla\Service\Data; +use VDM\Joomla\Interfaces\FactoryInterface; +use VDM\Joomla\Abstraction\Factory as ExtendingFactory; + + +/** + * Data Factory + * + * @since 3.2.2 + */ +abstract class Factory extends ExtendingFactory implements FactoryInterface +{ + /** + * Create a container object + * + * @return Container + * @since 3.2.2 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Table()) + ->registerServiceProvider(new Database()) + ->registerServiceProvider(new Model()) + ->registerServiceProvider(new Data()); + } +} + diff --git a/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.power b/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.power new file mode 100644 index 0000000..44214e9 --- /dev/null +++ b/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/code.power @@ -0,0 +1,14 @@ + /** + * Create a container object + * + * @return Container + * @since 3.2.2 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Table()) + ->registerServiceProvider(new Database()) + ->registerServiceProvider(new Model()) + ->registerServiceProvider(new Data()); + } \ No newline at end of file diff --git a/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/settings.json b/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/settings.json new file mode 100644 index 0000000..b015091 --- /dev/null +++ b/src/9d76b8dc-3883-4755-b11c-131d19ca8a53/settings.json @@ -0,0 +1,38 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "2e5bf608-de5c-4b00-a20d-47c26aa350d9", + "guid": "9d76b8dc-3883-4755-b11c-131d19ca8a53", + "implements": [ + "caf33c5d-858c-4f9a-894f-ab302ec5445a" + ], + "load_selection": null, + "name": "Factory", + "power_version": "1.0.0", + "system_name": "VDM.Data.Factory", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "19b2ba92-1655-4384-acfb-979c80de8b6d", + "as": "default" + }, + "use_selection1": { + "use": "4815e1c7-a433-443d-a112-d1e03d7df84b", + "as": "default" + }, + "use_selection2": { + "use": "2dcedd6c-c95b-4a37-9cac-95d28faedca3", + "as": "default" + }, + "use_selection3": { + "use": "a5daf189-3345-4b13-8716-c51f686f545b", + "as": "default" + } + }, + "extendsinterfaces": null, + "namespace": "[[[NamespacePrefix]]]\\Joomla\\Data.Factory", + "description": "Data Factory\r\n\r\n@since 3.2.2", + "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \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": "" +} \ No newline at end of file diff --git a/src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/code.php b/src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/code.php index 200e330..9fb540c 100644 --- a/src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/code.php +++ b/src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/code.php @@ -18,7 +18,7 @@ use VDM\Joomla\Abstraction\Schema as ExtendingSchema; /** - * JCB Tables Schema + * Componentbuilder Tables Schema * * @since 3.2.1 */ diff --git a/src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/settings.json b/src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/settings.json index c905a9a..7a79324 100644 --- a/src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/settings.json +++ b/src/b3d2ec33-76d4-4c3b-bb2c-86ac14a221ce/settings.json @@ -9,7 +9,7 @@ "load_selection": null, "name": "Schema", "power_version": "2.0.0", - "system_name": "JCB.Table.Schema", + "system_name": "VDM.Table.Schema", "type": "final class", "use_selection": { "use_selection0": { @@ -18,8 +18,8 @@ } }, "extendsinterfaces": null, - "namespace": "[[[NamespacePrefix]]]\\Joomla\\Componentbuilder.Table.Schema", - "description": "JCB Tables Schema\r\n\r\n@since 3.2.1", + "namespace": "[[[NamespacePrefix]]]\\Joomla\\[[[Component]]].Table.Schema", + "description": "[[[Component]]] Tables Schema\r\n\r\n@since 3.2.1", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/README.md b/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/README.md index 8215d1d..0f47fd4 100644 --- a/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/README.md +++ b/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/README.md @@ -6,12 +6,12 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# class Table (Details) +# final class Table (Details) > namespace: **VDM\Joomla\Componentbuilder** > extends: **BaseTable** ```uml @startuml -class Table #Gold { +class Table << (F,LightGreen) >> #RoyalBlue { } @enduml diff --git a/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.php b/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.php index 004ac74..17510e4 100644 --- a/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.php +++ b/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/code.php @@ -17,11 +17,11 @@ use VDM\Joomla\Abstraction\BaseTable; /** - * JCB Tables + * Componentbuilder Tables * * @since 3.2.0 */ -class Table extends BaseTable implements Tableinterface +final class Table extends BaseTable implements Tableinterface { /** * All areas/views/tables with their field details diff --git a/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/settings.json b/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/settings.json index eabd6de..05bda44 100644 --- a/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/settings.json +++ b/src/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8/settings.json @@ -9,12 +9,12 @@ "load_selection": null, "name": "Table", "power_version": "2.0.0", - "system_name": "JCB.Table", - "type": "class", + "system_name": "VDM.Table", + "type": "final class", "use_selection": null, "extendsinterfaces": null, - "namespace": "[[[NamespacePrefix]]]\\Joomla\\Componentbuilder.Table", - "description": "JCB Tables\r\n\r\n@since 3.2.0", + "namespace": "[[[NamespacePrefix]]]\\Joomla\\[[[Component]]].Table", + "description": "[[[Component]]] Tables\r\n\r\n@since 3.2.0", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "", "composer": "" diff --git a/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/README.md b/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/README.md index 5995530..890c0a8 100644 --- a/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/README.md +++ b/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/README.md @@ -14,6 +14,7 @@ interface LoadInterface #Lavender { + table(?string $table) : self + value(array $keys, string $field) : mixed + + values(array $keys, string $field) : ?array + item(array $keys) : ?object + items(array $keys) : ?array + getTable() : string @@ -38,6 +39,18 @@ Example: $this->value( return: mixed end note +note right of LoadInterface::values + Get a value from multiple rows from a given table +Example: $this->values( +[ +'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' +], 'value_key' +); + + since: 3.2.2 + return: ?array +end note + note right of LoadInterface::item Get values from a given table Example: $this->item( diff --git a/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/code.php b/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/code.php index f43616f..2eec35c 100644 --- a/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/code.php +++ b/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/code.php @@ -45,6 +45,22 @@ interface LoadInterface */ public function value(array $keys, string $field); + /** + * Get a value from multiple rows from a given table + * Example: $this->values( + * [ + * 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + * ], 'value_key' + * ); + * + * @param array $keys The item keys + * @param string $field The field key + * + * @return array|null + * @since 3.2.2 + */ + public function values(array $keys, string $field): ?array; + /** * Get values from a given table * Example: $this->item( diff --git a/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/code.power b/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/code.power index 4e5e884..2e38e05 100644 --- a/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/code.power +++ b/src/c548640c-a461-4424-9ac5-8dfb5ed06d8d/code.power @@ -24,6 +24,22 @@ */ public function value(array $keys, string $field); + /** + * Get a value from multiple rows from a given table + * Example: $this->values( + * [ + * 'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + * ], 'value_key' + * ); + * + * @param array $keys The item keys + * @param string $field The field key + * + * @return array|null + * @since 3.2.2 + */ + public function values(array $keys, string $field): ?array; + /** * Get values from a given table * Example: $this->item( diff --git a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/README.md b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/README.md index 1de895a..39daa0e 100644 --- a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/README.md +++ b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/README.md @@ -19,14 +19,14 @@ interface FactoryInterface #Lavender { note right of FactoryInterface::_ Get any class from the container - since: 3.2.0 + since: 0.0.0 return: Mixed end note note right of FactoryInterface::getContainer Get the global container - since: 3.2.0 + since: 0.0.0 return: Container end note diff --git a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php index 0dd2e4c..d623032 100644 --- a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php +++ b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.php @@ -16,7 +16,9 @@ use Joomla\DI\Container; /** - * The Container Factory Interface + * The Container Factory Interface + * + * @since 0.0.0 */ interface FactoryInterface { @@ -26,7 +28,7 @@ interface FactoryInterface * @param string $key The container class key * * @return Mixed - * @since 3.2.0 + * @since 0.0.0 */ public static function _(string $key); @@ -34,7 +36,7 @@ interface FactoryInterface * Get the global container * * @return Container - * @since 3.2.0 + * @since 0.0.0 */ public static function getContainer(): Container; } diff --git a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.power b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.power index 2b6ce65..c1312b0 100644 --- a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.power +++ b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/code.power @@ -4,7 +4,7 @@ * @param string $key The container class key * * @return Mixed - * @since 3.2.0 + * @since 0.0.0 */ public static function _(string $key); @@ -12,6 +12,6 @@ * Get the global container * * @return Container - * @since 3.2.0 + * @since 0.0.0 */ public static function getContainer(): Container; \ No newline at end of file diff --git a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json index 7eb747d..3cf8ea2 100644 --- a/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json +++ b/src/caf33c5d-858c-4f9a-894f-ab302ec5445a/settings.json @@ -12,7 +12,7 @@ "use_selection": null, "extendsinterfaces": null, "namespace": "[[[NamespacePrefix]]]\\Joomla\\Interfaces.FactoryInterface", - "description": "The Container Factory Interface", + "description": "The Container Factory Interface\r\n\r\n@since 0.0.0", "licensing_template": "\/**\r\n * @package Joomla.Component.Builder\r\n *\r\n * @created 4th September, 2022\r\n * @author Llewellyn van der Merwe \r\n * @git Joomla Component Builder \r\n * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.\r\n * @license GNU General Public License version 2 or later; see LICENSE.txt\r\n *\/\r\n", "head": "use Joomla\\DI\\Container;", "composer": "" diff --git a/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/code.php b/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/code.php index 1f89e7b..d3bfcdf 100644 --- a/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/code.php +++ b/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/code.php @@ -14,6 +14,7 @@ namespace VDM\Joomla\Utilities; use Joomla\CMS\Factory; use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Data\Factory as Data; /** @@ -35,6 +36,8 @@ abstract class GetHelper * * @return mixed string/int/float * @since 3.0.9 + * + * @deprecated 5.1 Use Data::_('Load')->table($table)->value(...) */ public static function var(?string $table = null, $where = null, string $whereString = 'user', string $what = 'id', @@ -103,6 +106,8 @@ abstract class GetHelper * * @return array|null * @since 3.0.9 + * + * @deprecated 5.1 Use Data::_('Load')->table($table)->values(...) */ public static function vars(?string $table = null, $where = null, string $whereString = 'user', string $what = 'id', string $operator = 'IN', diff --git a/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/code.power b/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/code.power index dba9769..f871d60 100644 --- a/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/code.power +++ b/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/code.power @@ -10,6 +10,8 @@ * * @return mixed string/int/float * @since 3.0.9 + * + * @deprecated 5.1 Use Data::_('Load')->table($table)->value(...) */ public static function var(?string $table = null, $where = null, string $whereString = 'user', string $what = 'id', @@ -78,6 +80,8 @@ * * @return array|null * @since 3.0.9 + * + * @deprecated 5.1 Use Data::_('Load')->table($table)->values(...) */ public static function vars(?string $table = null, $where = null, string $whereString = 'user', string $what = 'id', string $operator = 'IN', diff --git a/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/settings.json b/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/settings.json index 1643eb9..e1971d8 100644 --- a/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/settings.json +++ b/src/db87c339-5bb6-4291-a7ef-2c48ea1b06bc/settings.json @@ -20,6 +20,10 @@ "use_selection0": { "use": "640b5352-fb09-425f-a26e-cd44eda03f15", "as": "default" + }, + "use_selection1": { + "use": "9d76b8dc-3883-4755-b11c-131d19ca8a53", + "as": "Data" } }, "extendsinterfaces": null, diff --git a/super-powers.json b/super-powers.json index fd39144..4a0b1fe 100644 --- a/super-powers.json +++ b/super-powers.json @@ -98,6 +98,17 @@ "spk": "Super__152c8793_8b75_4715_996a_257b9f65451c__Power", "guid": "152c8793-8b75-4715-996a-257b9f65451c" }, + "19b2ba92-1655-4384-acfb-979c80de8b6d": { + "name": "Table", + "type": "class", + "namespace": "VDM\\Joomla\\Service", + "code": "src\/19b2ba92-1655-4384-acfb-979c80de8b6d\/code.php", + "power": "src\/19b2ba92-1655-4384-acfb-979c80de8b6d\/code.power", + "settings": "src\/19b2ba92-1655-4384-acfb-979c80de8b6d\/settings.json", + "path": "src\/19b2ba92-1655-4384-acfb-979c80de8b6d", + "spk": "Super__19b2ba92_1655_4384_acfb_979c80de8b6d__Power", + "guid": "19b2ba92-1655-4384-acfb-979c80de8b6d" + }, "1f28cb53-60d9-4db1-b517-3c7dc6b429ef": { "name": "StringHelper", "type": "abstract class", @@ -164,6 +175,17 @@ "spk": "Super__2dcedd6c_c95b_4a37_9cac_95d28faedca3__Power", "guid": "2dcedd6c-c95b-4a37-9cac-95d28faedca3" }, + "2e5bf608-de5c-4b00-a20d-47c26aa350d9": { + "name": "Factory", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Abstraction", + "code": "src\/2e5bf608-de5c-4b00-a20d-47c26aa350d9\/code.php", + "power": "src\/2e5bf608-de5c-4b00-a20d-47c26aa350d9\/code.power", + "settings": "src\/2e5bf608-de5c-4b00-a20d-47c26aa350d9\/settings.json", + "path": "src\/2e5bf608-de5c-4b00-a20d-47c26aa350d9", + "spk": "Super__2e5bf608_de5c_4b00_a20d_47c26aa350d9__Power", + "guid": "2e5bf608-de5c-4b00-a20d-47c26aa350d9" + }, "30c5b4c2-f75f-4d15-869a-f8bfedd87358": { "name": "ClassfunctionHelper", "type": "abstract class", @@ -441,7 +463,7 @@ }, "85785701-07b2-4f81-bc1e-0f423700c254": { "name": "Subform", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Data", "code": "src\/85785701-07b2-4f81-bc1e-0f423700c254\/code.php", "power": "src\/85785701-07b2-4f81-bc1e-0f423700c254\/code.power", @@ -527,6 +549,17 @@ "spk": "Super__9c513baf_b279_43fd_ae29_a585c8cbc4f0__Power", "guid": "9c513baf-b279-43fd-ae29-a585c8cbc4f0" }, + "9d76b8dc-3883-4755-b11c-131d19ca8a53": { + "name": "Factory", + "type": "abstract class", + "namespace": "VDM\\Joomla\\Data", + "code": "src\/9d76b8dc-3883-4755-b11c-131d19ca8a53\/code.php", + "power": "src\/9d76b8dc-3883-4755-b11c-131d19ca8a53\/code.power", + "settings": "src\/9d76b8dc-3883-4755-b11c-131d19ca8a53\/settings.json", + "path": "src\/9d76b8dc-3883-4755-b11c-131d19ca8a53", + "spk": "Super__9d76b8dc_3883_4755_b11c_131d19ca8a53__Power", + "guid": "9d76b8dc-3883-4755-b11c-131d19ca8a53" + }, "9ef0eb24-aae4-4f5a-99af-d724db44808f": { "name": "FieldHelper", "type": "abstract class", @@ -639,7 +672,7 @@ }, "bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8": { "name": "Table", - "type": "class", + "type": "final class", "namespace": "VDM\\Joomla\\Componentbuilder", "code": "src\/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8\/code.php", "power": "src\/bfd1d6d5-56c1-4fe9-9fee-1c5910e1f5d8\/code.power",