diff --git a/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/README.md b/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/README.md new file mode 100644 index 0000000..992f547 --- /dev/null +++ b/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/README.md @@ -0,0 +1,78 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface MultiSubformInterface (Details) +> namespace: **VDM\Joomla\Interfaces\Data** +> extends: **** +```uml +@startuml +interface MultiSubformInterface #Lavender { + + get(array $getMap) : ?array + + set(array $items, array $setMap) : bool +} + +note right of MultiSubformInterface::get + Get a subform items +Example: +$getMap = [ +'_core' => [ +'table' =>'data', +'linkValue' => $item->guid ?? '', +'linkKey' => 'look', +'field' => 'data', +'get' => ['guid','email','image','mobile_phone','website','dateofbirth'] +], +'countries' => [ +'table' =>'data_country', +'linkValue' => 'data:guid', // coretable:fieldname +'linkKey' => 'data', +'get' => ['guid','country','currency'] +] +]; + + since: 3.2.2 + return: ?array +end note + +note right of MultiSubformInterface::set + Set a subform items +Example: +$items, +$setMap = [ +'_core' => [ +'table' =>'data', +'indexKey' => 'guid', +'linkKey' => 'look', +'linkValue' => $data['guid'] ?? '' +], +'countries' => [ +'table' =>'data_country', +'indexKey' => 'guid', +'linkKey' => 'data', +'linkValue' => 'data:guid' // coretable:fieldname +] +]; + + since: 3.2.2 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/code.php b/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/code.php new file mode 100644 index 0000000..285318d --- /dev/null +++ b/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/code.php @@ -0,0 +1,77 @@ + + * @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\Interfaces\Data; + + +/** + * Data Multi Subform Interface + * + * @since 3.2.2 + */ +interface MultiSubformInterface +{ + /** + * Get a subform items + * + * @param array $getMap The the map to get the subfrom data + * + * Example: + * $getMap = [ + * '_core' => [ + * 'table' =>'data', + * 'linkValue' => $item->guid ?? '', + * 'linkKey' => 'look', + * 'field' => 'data', + * 'get' => ['guid','email','image','mobile_phone','website','dateofbirth'] + * ], + * 'countries' => [ + * 'table' =>'data_country', + * 'linkValue' => 'data:guid', // coretable:fieldname + * 'linkKey' => 'data', + * 'get' => ['guid','country','currency'] + * ] + * ]; + * + * @return array|null The subform + * @since 3.2.2 + */ + public function get(array $getMap): ?array; + + /** + * Set a subform items + * + * @param array $items The list of items from the subform to set + * @param array $setMap The the map to set the subfrom data + * + * Example: + * $items, + * $setMap = [ + * '_core' => [ + * 'table' =>'data', + * 'indexKey' => 'guid', + * 'linkKey' => 'look', + * 'linkValue' => $data['guid'] ?? '' + * ], + * 'countries' => [ + * 'table' =>'data_country', + * 'indexKey' => 'guid', + * 'linkKey' => 'data', + * 'linkValue' => 'data:guid' // coretable:fieldname + * ] + * ]; + * + * @return bool + * @since 3.2.2 + */ + public function set(array $items, array $setMap): bool; +} + diff --git a/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/code.power b/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/code.power new file mode 100644 index 0000000..4a3addc --- /dev/null +++ b/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/code.power @@ -0,0 +1,54 @@ + /** + * Get a subform items + * + * @param array $getMap The the map to get the subfrom data + * + * Example: + * $getMap = [ + * '_core' => [ + * 'table' =>'data', + * 'linkValue' => $item->guid ?? '', + * 'linkKey' => 'look', + * 'field' => 'data', + * 'get' => ['guid','email','image','mobile_phone','website','dateofbirth'] + * ], + * 'countries' => [ + * 'table' =>'data_country', + * 'linkValue' => 'data:guid', // coretable:fieldname + * 'linkKey' => 'data', + * 'get' => ['guid','country','currency'] + * ] + * ]; + * + * @return array|null The subform + * @since 3.2.2 + */ + public function get(array $getMap): ?array; + + /** + * Set a subform items + * + * @param array $items The list of items from the subform to set + * @param array $setMap The the map to set the subfrom data + * + * Example: + * $items, + * $setMap = [ + * '_core' => [ + * 'table' =>'data', + * 'indexKey' => 'guid', + * 'linkKey' => 'look', + * 'linkValue' => $data['guid'] ?? '' + * ], + * 'countries' => [ + * 'table' =>'data_country', + * 'indexKey' => 'guid', + * 'linkKey' => 'data', + * 'linkValue' => 'data:guid' // coretable:fieldname + * ] + * ]; + * + * @return bool + * @since 3.2.2 + */ + public function set(array $items, array $setMap): bool; \ No newline at end of file diff --git a/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/settings.json b/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/settings.json new file mode 100644 index 0000000..203caba --- /dev/null +++ b/src/bb30f709-53d2-446a-ab3d-300fe6de0bc8/settings.json @@ -0,0 +1,19 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "", + "guid": "bb30f709-53d2-446a-ab3d-300fe6de0bc8", + "implements": null, + "load_selection": null, + "name": "MultiSubformInterface", + "power_version": "1.0.0", + "system_name": "VDM.Interfaces.Data.MultiSubformInterface", + "type": "interface", + "use_selection": null, + "extendsinterfaces": null, + "namespace": "[[[NamespacePrefix]]]\\Joomla\\Interfaces.Data.MultiSubformInterface", + "description": "Data Multi Subform Interface\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": "", + "composer": "" +} \ No newline at end of file