From f2d30e9eb5034b30dfe6986628e7eaaa7d99c378 Mon Sep 17 00:00:00 2001 From: aB0t Date: Sun, 30 Apr 2023 01:34:29 +0200 Subject: [PATCH] update 2023-04-30 01:34:12 --- README.md | 23 +++++ .../README.md | 83 +++++++++++++++++++ .../code.php | 73 ++++++++++++++++ .../code.power | 49 +++++++++++ .../settings.json | 18 ++++ super-powers.json | 10 +++ 6 files changed, 256 insertions(+) create mode 100644 src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/README.md create mode 100644 src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/code.php create mode 100644 src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/code.power create mode 100644 src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/settings.json diff --git a/README.md b/README.md index 88fe04a..cf0043d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ This repository contains an index (see below) of all the approved powers within # Index of powers +- **Namespace**: [VDM\Joomla\Componentbuilder\Interfaces](#vdm-joomla-componentbuilder-interfaces) + + - **interface UpdateInterface** | [Details](src/7179fde6-1e51-4b51-8545-7ca18f74a0f4) | [Code](src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/code.php) | [Settings](src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/settings.json) | [7179fde6-1e51-4b51-8545-7ca18f74a0f4](src/7179fde6-1e51-4b51-8545-7ca18f74a0f4) - **Namespace**: [VDM\Joomla\Componentbuilder\Search](#vdm-joomla-componentbuilder-search) - **abstract class Factory** | [Details](src/01a89ba8-f8bb-435c-93de-0a8f3fa9432a) | [Code](src/01a89ba8-f8bb-435c-93de-0a8f3fa9432a/code.php) | [Settings](src/01a89ba8-f8bb-435c-93de-0a8f3fa9432a/settings.json) | [01a89ba8-f8bb-435c-93de-0a8f3fa9432a](src/01a89ba8-f8bb-435c-93de-0a8f3fa9432a) @@ -66,6 +69,26 @@ This repository contains an index (see below) of all the approved powers within # Class Diagrams +## VDM Joomla Componentbuilder Interfaces +> namespace VDM\Joomla\Componentbuilder\Interfaces +```uml +@startuml + +namespace VDM\Joomla\Componentbuilder\Interfaces #Olive { + + + interface UpdateInterface #Lavender { + + rows() : bool + + items() : bool + + row() : bool + + item() : bool + } +} + + +@enduml +``` + ## VDM Joomla Componentbuilder Search > namespace VDM\Joomla\Componentbuilder\Search ```uml diff --git a/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/README.md b/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/README.md new file mode 100644 index 0000000..0326e39 --- /dev/null +++ b/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/README.md @@ -0,0 +1,83 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface UpdateInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface UpdateInterface #Lavender { + + rows(array $data, string $key, ...) : bool + + items(array $data, string $key, ...) : bool + + row(array $data, string $key, ...) : bool + + item(object $data, string $key, ...) : bool +} + +note right of UpdateInterface::rows + Update rows in the database (with remapping and filtering columns option) + + since: 3.2.0 + return: bool + + arguments: + array $data + string $key + string $table + array $columns = [] +end note + +note right of UpdateInterface::items + Update items in the database (with remapping and filtering columns option) + + since: 3.2.0 + return: bool + + arguments: + array $data + string $key + string $table + array $columns = [] +end note + +note right of UpdateInterface::row + Update row in the database + + since: 3.2.0 + return: bool + + arguments: + array $data + string $key + string $table +end note + +note right of UpdateInterface::item + Update item in the database + + since: 3.2.0 + return: bool + + arguments: + object $data + string $key + string $table +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/code.php b/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/code.php new file mode 100644 index 0000000..3e0cba0 --- /dev/null +++ b/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/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\Componentbuilder\Interfaces; + + +/** + * Database Update Interface + * + * @since 3.2.0 + */ +interface UpdateInterface +{ + /** + * Update rows in the database (with remapping and filtering columns option) + * + * @param array $data Dataset to update in database [array of arrays (key => value)] + * @param string $key Dataset key column to use in updating the values in the Database + * @param string $table The table where the data is being updated + * @param array $columns Data columns for remapping and filtering + * + * @return bool + * @since 3.2.0 + **/ + public function rows(array $data, string $key, string $table, array $columns = []): bool; + + /** + * Update items in the database (with remapping and filtering columns option) + * + * @param array $data Data to updated in database (array of objects) + * @param string $key Dataset key column to use in updating the values in the Database + * @param string $table The table where the data is being update + * @param array $columns Data columns for remapping and filtering + * + * @return bool + * @since 3.2.0 + **/ + public function items(array $data, string $key, string $table, array $columns = []): bool; + + /** + * Update row in the database + * + * @param array $data Dataset to update in database (key => value) + * @param string $key Dataset key column to use in updating the values in the Database + * @param string $table The table where the data is being updated + * + * @return bool + * @since 3.2.0 + **/ + public function row(array $data, string $key, string $table): bool; + + /** + * Update item in the database + * + * @param object $data Dataset to update in database (key => value) + * @param string $key Dataset key column to use in updating the values in the Database + * @param string $table The table where the data is being updated + * + * @return bool + * @since 3.2.0 + **/ + public function item(object $data, string $key, string $table): bool; + +} + diff --git a/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/code.power b/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/code.power new file mode 100644 index 0000000..abad002 --- /dev/null +++ b/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/code.power @@ -0,0 +1,49 @@ + /** + * Update rows in the database (with remapping and filtering columns option) + * + * @param array $data Dataset to update in database [array of arrays (key => value)] + * @param string $key Dataset key column to use in updating the values in the Database + * @param string $table The table where the data is being updated + * @param array $columns Data columns for remapping and filtering + * + * @return bool + * @since 3.2.0 + **/ + public function rows(array $data, string $key, string $table, array $columns = []): bool; + + /** + * Update items in the database (with remapping and filtering columns option) + * + * @param array $data Data to updated in database (array of objects) + * @param string $key Dataset key column to use in updating the values in the Database + * @param string $table The table where the data is being update + * @param array $columns Data columns for remapping and filtering + * + * @return bool + * @since 3.2.0 + **/ + public function items(array $data, string $key, string $table, array $columns = []): bool; + + /** + * Update row in the database + * + * @param array $data Dataset to update in database (key => value) + * @param string $key Dataset key column to use in updating the values in the Database + * @param string $table The table where the data is being updated + * + * @return bool + * @since 3.2.0 + **/ + public function row(array $data, string $key, string $table): bool; + + /** + * Update item in the database + * + * @param object $data Dataset to update in database (key => value) + * @param string $key Dataset key column to use in updating the values in the Database + * @param string $table The table where the data is being updated + * + * @return bool + * @since 3.2.0 + **/ + public function item(object $data, string $key, string $table): bool; diff --git a/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/settings.json b/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/settings.json new file mode 100644 index 0000000..c20ef53 --- /dev/null +++ b/src/7179fde6-1e51-4b51-8545-7ca18f74a0f4/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "7179fde6-1e51-4b51-8545-7ca18f74a0f4", + "implements": null, + "load_selection": null, + "name": "UpdateInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.UpdateInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.UpdateInterface", + "description": "Database Update Interface\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": "" +} \ No newline at end of file diff --git a/super-powers.json b/super-powers.json index 33ec46a..fba9b9a 100644 --- a/super-powers.json +++ b/super-powers.json @@ -238,5 +238,15 @@ "settings": "src\/01a89ba8-f8bb-435c-93de-0a8f3fa9432a\/settings.json", "path": "src\/01a89ba8-f8bb-435c-93de-0a8f3fa9432a", "guid": "01a89ba8-f8bb-435c-93de-0a8f3fa9432a" + }, + "7179fde6-1e51-4b51-8545-7ca18f74a0f4": { + "name": "UpdateInterface", + "type": "interface", + "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces", + "code": "src\/7179fde6-1e51-4b51-8545-7ca18f74a0f4\/code.php", + "power": "src\/7179fde6-1e51-4b51-8545-7ca18f74a0f4\/code.power", + "settings": "src\/7179fde6-1e51-4b51-8545-7ca18f74a0f4\/settings.json", + "path": "src\/7179fde6-1e51-4b51-8545-7ca18f74a0f4", + "guid": "7179fde6-1e51-4b51-8545-7ca18f74a0f4" } } \ No newline at end of file