diff --git a/README.md b/README.md index 985a232..219c353 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ This repository contains an index (see below) of all the approved powers within - **abstract class Factory** | [Details](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac) | [Code](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php) | [Settings](src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json) | Super__d910d8b8_4c23_4f3e_8cda_438f2d2bd7ac__Power - **final class Component** | [Details](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0) | [Code](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/code.php) | [Settings](src/e2472b22-a329-44d8-b4a2-ae3ba99e17a0/settings.json) | Super__e2472b22_a329_44d8_b4a2_ae3ba99e17a0__Power + - **final class JoomlaPower** | [Details](src/3730a000-ab64-477d-8b0f-70eaf71b517a) | [Code](src/3730a000-ab64-477d-8b0f-70eaf71b517a/code.php) | [Settings](src/3730a000-ab64-477d-8b0f-70eaf71b517a/settings.json) | Super__3730a000_ab64_477d_8b0f_70eaf71b517a__Power - **class Config** | [Details](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc) | [Code](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/code.php) | [Settings](src/fa4bf18e-301e-42e3-91fb-6e0096c07adc/settings.json) | Super__fa4bf18e_301e_42e3_91fb_6e0096c07adc__Power - **class Customcode** | [Details](src/313b43c4-98c3-4f62-9177-2d73ec8eba31) | [Code](src/313b43c4-98c3-4f62-9177-2d73ec8eba31/code.php) | [Settings](src/313b43c4-98c3-4f62-9177-2d73ec8eba31/settings.json) | Super__313b43c4_98c3_4f62_9177_2d73ec8eba31__Power - **class Field** | [Details](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75) | [Code](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/code.php) | [Settings](src/d7ba2d5d-10b6-470d-978d-9f91ea65ee75/settings.json) | Super__d7ba2d5d_10b6_470d_978d_9f91ea65ee75__Power @@ -40,14 +41,21 @@ This repository contains an index (see below) of all the approved powers within - **Namespace**: [VDM\Joomla\Componentbuilder\Interfaces](#vdm-joomla-componentbuilder-interfaces) - **interface Cryptinterface** | [Details](src/81de8f57-dd9c-4a17-964f-848cd4a0743b) | [Code](src/81de8f57-dd9c-4a17-964f-848cd4a0743b/code.php) | [Settings](src/81de8f57-dd9c-4a17-964f-848cd4a0743b/settings.json) | Super__81de8f57_dd9c_4a17_964f_848cd4a0743b__Power + - **interface GrepInterface** | [Details](src/c182506a-ab84-439c-b962-1e606b58d545) | [Code](src/c182506a-ab84-439c-b962-1e606b58d545/code.php) | [Settings](src/c182506a-ab84-439c-b962-1e606b58d545/settings.json) | Super__c182506a_ab84_439c_b962_1e606b58d545__Power - **interface Serverinterface** | [Details](src/86ac0760-26f5-4746-9c7f-ce77860f80f8) | [Code](src/86ac0760-26f5-4746-9c7f-ce77860f80f8/code.php) | [Settings](src/86ac0760-26f5-4746-9c7f-ce77860f80f8/settings.json) | Super__86ac0760_26f5_4746_9c7f_ce77860f80f8__Power + - **interface SuperInterface** | [Details](src/51de80f2-2868-4c2c-8198-ef79349e9bd7) | [Code](src/51de80f2-2868-4c2c-8198-ef79349e9bd7/code.php) | [Settings](src/51de80f2-2868-4c2c-8198-ef79349e9bd7/settings.json) | Super__51de80f2_2868_4c2c_8198_ef79349e9bd7__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\JoomlaPower](#vdm-joomla-componentbuilder-joomlapower) + + - **abstract class Factory** | [Details](src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400) | [Code](src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/code.php) | [Settings](src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/settings.json) | Super__6ee3dc9e_1949_4da5_a74f_d9eb7f14e400__Power + - **final class Grep** | [Details](src/355bf21a-f859-4528-9110-bcd2c6d05ea7) | [Code](src/355bf21a-f859-4528-9110-bcd2c6d05ea7/code.php) | [Settings](src/355bf21a-f859-4528-9110-bcd2c6d05ea7/settings.json) | Super__355bf21a_f859_4528_9110_bcd2c6d05ea7__Power + - **final class Super** | [Details](src/39a75870-a7f7-45fd-937d-5ba97b85b8ad) | [Code](src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/code.php) | [Settings](src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/settings.json) | Super__39a75870_a7f7_45fd_937d_5ba97b85b8ad__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Power](#vdm-joomla-componentbuilder-power) - **abstract class Factory** | [Details](src/a5734b9e-a72d-494c-bc72-c3bc7506015f) | [Code](src/a5734b9e-a72d-494c-bc72-c3bc7506015f/code.php) | [Settings](src/a5734b9e-a72d-494c-bc72-c3bc7506015f/settings.json) | Super__a5734b9e_a72d_494c_bc72_c3bc7506015f__Power - **final class Generator** | [Details](src/505801ac-d3e2-44c6-a300-9a57a96170c6) | [Code](src/505801ac-d3e2-44c6-a300-9a57a96170c6/code.php) | [Settings](src/505801ac-d3e2-44c6-a300-9a57a96170c6/settings.json) | Super__505801ac_d3e2_44c6_a300_9a57a96170c6__Power - - **final class Grep** | [Details](src/6784dd52-0909-451a-a872-9a942a023c68) | [Code](src/6784dd52-0909-451a-a872-9a942a023c68/code.php) | [Settings](src/6784dd52-0909-451a-a872-9a942a023c68/settings.json) | Super__6784dd52_0909_451a_a872_9a942a023c68__Power - - **final class Super** | [Details](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff) | [Code](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.php) | [Settings](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/settings.json) | Super__3ab0eba9_f37b_4b37_aec1_2e78067f2aff__Power - **class Config** | [Details](src/be4ccfae-65a9-401e-bdbe-637d8c226954) | [Code](src/be4ccfae-65a9-401e-bdbe-637d8c226954/code.php) | [Settings](src/be4ccfae-65a9-401e-bdbe-637d8c226954/settings.json) | Super__be4ccfae_65a9_401e_bdbe_637d8c226954__Power + - **class Grep** | [Details](src/6784dd52-0909-451a-a872-9a942a023c68) | [Code](src/6784dd52-0909-451a-a872-9a942a023c68/code.php) | [Settings](src/6784dd52-0909-451a-a872-9a942a023c68/settings.json) | Super__6784dd52_0909_451a_a872_9a942a023c68__Power + - **class Super** | [Details](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff) | [Code](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.php) | [Settings](src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/settings.json) | Super__3ab0eba9_f37b_4b37_aec1_2e78067f2aff__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Service](#vdm-joomla-componentbuilder-service) - **class CoreRules** | [Details](src/f65b52c2-593a-4c35-89d1-4a8e57a1adf0) | [Code](src/f65b52c2-593a-4c35-89d1-4a8e57a1adf0/code.php) | [Settings](src/f65b52c2-593a-4c35-89d1-4a8e57a1adf0/settings.json) | Super__f65b52c2_593a_4c35_89d1_4a8e57a1adf0__Power @@ -252,6 +260,10 @@ This repository contains an index (see below) of all the approved powers within - **final class Event** | [Details](src/4729c2b0-f12b-4397-8d77-055d38bca98b) | [Code](src/4729c2b0-f12b-4397-8d77-055d38bca98b/code.php) | [Settings](src/4729c2b0-f12b-4397-8d77-055d38bca98b/settings.json) | Super__4729c2b0_f12b_4397_8d77_055d38bca98b__Power - **final class Header** | [Details](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49) | [Code](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/code.php) | [Settings](src/1ee227b9-da0f-4e7b-ae66-99a9d53f6f49/settings.json) | Super__1ee227b9_da0f_4e7b_ae66_99a9d53f6f49__Power - **final class History** | [Details](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba) | [Code](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/code.php) | [Settings](src/25c7ca86-6088-4f5f-b9fe-13504779c6ba/settings.json) | Super__25c7ca86_6088_4f5f_b9fe_13504779c6ba__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaPower](#vdm-joomla-componentbuilder-compiler-joomlapower) + + - **final class Extractor** | [Details](src/82505f3f-297f-4d75-a581-929ab3e93689) | [Code](src/82505f3f-297f-4d75-a581-929ab3e93689/code.php) | [Settings](src/82505f3f-297f-4d75-a581-929ab3e93689/settings.json) | Super__82505f3f_297f_4d75_a581_929ab3e93689__Power + - **final class Injector** | [Details](src/a6052fe9-0d2b-4b36-b3e7-03b47c483542) | [Code](src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/code.php) | [Settings](src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/settings.json) | Super__a6052fe9_0d2b_4b36_b3e7_03b47c483542__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\JoomlaThree](#vdm-joomla-componentbuilder-compiler-joomlathree) - **final class Event** | [Details](src/4b86f62e-ce41-4325-a11a-08148807d0df) | [Code](src/4b86f62e-ce41-4325-a11a-08148807d0df/code.php) | [Settings](src/4b86f62e-ce41-4325-a11a-08148807d0df/settings.json) | Super__4b86f62e_ce41_4325_a11a_08148807d0df__Power @@ -318,11 +330,11 @@ This repository contains an index (see below) of all the approved powers within - **class Reverse** | [Details](src/ca111518-e47c-4049-b1b2-cb010f23866f) | [Code](src/ca111518-e47c-4049-b1b2-cb010f23866f/code.php) | [Settings](src/ca111518-e47c-4049-b1b2-cb010f23866f/settings.json) | Super__ca111518_e47c_4049_b1b2_cb010f23866f__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Power](#vdm-joomla-componentbuilder-compiler-power) - - **final class Extractor** | [Details](src/eeb03266-22fd-45bb-953a-961bb6be3a54) | [Code](src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php) | [Settings](src/eeb03266-22fd-45bb-953a-961bb6be3a54/settings.json) | Super__eeb03266_22fd_45bb_953a_961bb6be3a54__Power - - **final class Injector** | [Details](src/763d137c-42bc-4282-98d8-cc5c0654985f) | [Code](src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php) | [Settings](src/763d137c-42bc-4282-98d8-cc5c0654985f/settings.json) | Super__763d137c_42bc_4282_98d8_cc5c0654985f__Power - **final class Parser** | [Details](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205) | [Code](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/code.php) | [Settings](src/95d0e03f-24fd-4412-bc2e-f0899fcc3205/settings.json) | Super__95d0e03f_24fd_4412_bc2e_f0899fcc3205__Power - **class Autoloader** | [Details](src/6e64917c-d687-4ef3-a655-811319f5a81e) | [Code](src/6e64917c-d687-4ef3-a655-811319f5a81e/code.php) | [Settings](src/6e64917c-d687-4ef3-a655-811319f5a81e/settings.json) | Super__6e64917c_d687_4ef3_a655_811319f5a81e__Power + - **class Extractor** | [Details](src/eeb03266-22fd-45bb-953a-961bb6be3a54) | [Code](src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php) | [Settings](src/eeb03266-22fd-45bb-953a-961bb6be3a54/settings.json) | Super__eeb03266_22fd_45bb_953a_961bb6be3a54__Power - **class Infusion** | [Details](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c) | [Code](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/code.php) | [Settings](src/0419081e-4cb3-4c65-8c6a-ffe941fb0f1c/settings.json) | Super__0419081e_4cb3_4c65_8c6a_ffe941fb0f1c__Power + - **class Injector** | [Details](src/763d137c-42bc-4282-98d8-cc5c0654985f) | [Code](src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php) | [Settings](src/763d137c-42bc-4282-98d8-cc5c0654985f/settings.json) | Super__763d137c_42bc_4282_98d8_cc5c0654985f__Power - **class Plantuml** | [Details](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096) | [Code](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/code.php) | [Settings](src/ff5e9e63-86d0-4691-ab59-d4b9d9154096/settings.json) | Super__ff5e9e63_86d0_4691_ab59_d4b9d9154096__Power - **class Structure** | [Details](src/324566de-0f7d-4b6e-9caf-8424d55013ae) | [Code](src/324566de-0f7d-4b6e-9caf-8424d55013ae/code.php) | [Settings](src/324566de-0f7d-4b6e-9caf-8424d55013ae/settings.json) | Super__324566de_0f7d_4b6e_9caf_8424d55013ae__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Service](#vdm-joomla-componentbuilder-compiler-service) @@ -342,6 +354,7 @@ This repository contains an index (see below) of all the approved powers within - **class Field** | [Details](src/c6c30d66-3106-44eb-9272-b2cf7ec74613) | [Code](src/c6c30d66-3106-44eb-9272-b2cf7ec74613/code.php) | [Settings](src/c6c30d66-3106-44eb-9272-b2cf7ec74613/settings.json) | Super__c6c30d66_3106_44eb_9272_b2cf7ec74613__Power - **class Header** | [Details](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d) | [Code](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/code.php) | [Settings](src/36d49d4a-8d0e-435f-ab4c-8f247d96fd4d/settings.json) | Super__36d49d4a_8d0e_435f_ab4c_8f247d96fd4d__Power - **class History** | [Details](src/63782f74-7b03-4745-aa40-0adf8ed4e704) | [Code](src/63782f74-7b03-4745-aa40-0adf8ed4e704/code.php) | [Settings](src/63782f74-7b03-4745-aa40-0adf8ed4e704/settings.json) | Super__63782f74_7b03_4745_aa40_0adf8ed4e704__Power + - **class JoomlaPower** | [Details](src/5716c79f-a1c9-4059-9d00-8cccb9f9e061) | [Code](src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/code.php) | [Settings](src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/settings.json) | Super__5716c79f_a1c9_4059_9d00_8cccb9f9e061__Power - **class Joomlamodule** | [Details](src/295186de-5954-4a65-a4c1-2f79ef305743) | [Code](src/295186de-5954-4a65-a4c1-2f79ef305743/code.php) | [Settings](src/295186de-5954-4a65-a4c1-2f79ef305743/settings.json) | Super__295186de_5954_4a65_a4c1_2f79ef305743__Power - **class Joomlaplugin** | [Details](src/9eba241c-af90-42dd-ae05-92ff4d8391d3) | [Code](src/9eba241c-af90-42dd-ae05-92ff4d8391d3/code.php) | [Settings](src/9eba241c-af90-42dd-ae05-92ff4d8391d3/settings.json) | Super__9eba241c_af90_42dd_ae05_92ff4d8391d3__Power - **class Language** | [Details](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0) | [Code](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/code.php) | [Settings](src/9f00e793-86f8-4ef9-b775-a3eb129f83c0/settings.json) | Super__9f00e793_86f8_4ef9_b775_a3eb129f83c0__Power @@ -371,11 +384,28 @@ This repository contains an index (see below) of all the approved powers within - **class Pathfix** | [Details](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f) | [Code](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/code.php) | [Settings](src/cdc9b06d-8333-4fa7-ab4d-b810dd90f95f/settings.json) | Super__cdc9b06d_8333_4fa7_ab4d_b810dd90f95f__Power - **class Paths** | [Details](src/6f20369a-8536-4870-a1a3-cda254c939c8) | [Code](src/6f20369a-8536-4870-a1a3-cda254c939c8/code.php) | [Settings](src/6f20369a-8536-4870-a1a3-cda254c939c8/settings.json) | Super__6f20369a_8536_4870_a1a3_cda254c939c8__Power - **class Structure** | [Details](src/1efdded5-d6c8-452c-8f37-0374483a7b3f) | [Code](src/1efdded5-d6c8-452c-8f37-0374483a7b3f/code.php) | [Settings](src/1efdded5-d6c8-452c-8f37-0374483a7b3f/settings.json) | Super__1efdded5_d6c8_452c_8f37_0374483a7b3f__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Interfaces\Database](#vdm-joomla-componentbuilder-interfaces-database) + + - **interface InsertInterface** | [Details](src/95c02df3-fe0a-405b-b506-b7a5b8605b66) | [Code](src/95c02df3-fe0a-405b-b506-b7a5b8605b66/code.php) | [Settings](src/95c02df3-fe0a-405b-b506-b7a5b8605b66/settings.json) | Super__95c02df3_fe0a_405b_b506_b7a5b8605b66__Power + - **interface UpdateInterface** | [Details](src/69c29be3-ab25-4f56-944e-7ada6307b10c) | [Code](src/69c29be3-ab25-4f56-944e-7ada6307b10c/code.php) | [Settings](src/69c29be3-ab25-4f56-944e-7ada6307b10c/settings.json) | Super__69c29be3_ab25_4f56_944e_7ada6307b10c__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\JoomlaPower\Database](#vdm-joomla-componentbuilder-joomlapower-database) + + - **final class Insert** | [Details](src/9d53d45e-9b4d-45ec-827b-4916b91c907e) | [Code](src/9d53d45e-9b4d-45ec-827b-4916b91c907e/code.php) | [Settings](src/9d53d45e-9b4d-45ec-827b-4916b91c907e/settings.json) | Super__9d53d45e_9b4d_45ec_827b_4916b91c907e__Power + - **final class Load** | [Details](src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a) | [Code](src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/code.php) | [Settings](src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/settings.json) | Super__b4ea5de3_653f_43f9_b927_4ba6456b4d0a__Power + - **final class Update** | [Details](src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b) | [Code](src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/code.php) | [Settings](src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/settings.json) | Super__679473f6_3ea2_49d5_8273_1b29c8f0ad2b__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\JoomlaPower\Model](#vdm-joomla-componentbuilder-joomlapower-model) + + - **final class Load** | [Details](src/05744dd3-4030-4cf8-8dda-a93ab809b473) | [Code](src/05744dd3-4030-4cf8-8dda-a93ab809b473/code.php) | [Settings](src/05744dd3-4030-4cf8-8dda-a93ab809b473/settings.json) | Super__05744dd3_4030_4cf8_8dda_a93ab809b473__Power + - **final class Upsert** | [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 +- **Namespace**: [VDM\Joomla\Componentbuilder\JoomlaPower\Service](#vdm-joomla-componentbuilder-joomlapower-service) + + - **class Database** | [Details](src/a2992a91-eec2-4957-811b-8cde22aa1438) | [Code](src/a2992a91-eec2-4957-811b-8cde22aa1438/code.php) | [Settings](src/a2992a91-eec2-4957-811b-8cde22aa1438/settings.json) | Super__a2992a91_eec2_4957_811b_8cde22aa1438__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Power\Database](#vdm-joomla-componentbuilder-power-database) - - **final class Insert** | [Details](src/380bb7a3-cdcc-4336-a699-5070cbf521a5) | [Code](src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.php) | [Settings](src/380bb7a3-cdcc-4336-a699-5070cbf521a5/settings.json) | Super__380bb7a3_cdcc_4336_a699_5070cbf521a5__Power - - **final class Load** | [Details](src/1f86db0f-e271-45df-8795-3e503ec76698) | [Code](src/1f86db0f-e271-45df-8795-3e503ec76698/code.php) | [Settings](src/1f86db0f-e271-45df-8795-3e503ec76698/settings.json) | Super__1f86db0f_e271_45df_8795_3e503ec76698__Power - - **final class Update** | [Details](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3) | [Code](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.php) | [Settings](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/settings.json) | Super__e543c123_b1d9_4a0b_83b2_a9d371da5ff3__Power + - **interface LoadInterface** | [Details](src/99786f53-64b7-4d52-95b0-5306e7386c3f) | [Code](src/99786f53-64b7-4d52-95b0-5306e7386c3f/code.php) | [Settings](src/99786f53-64b7-4d52-95b0-5306e7386c3f/settings.json) | Super__99786f53_64b7_4d52_95b0_5306e7386c3f__Power + - **class Insert** | [Details](src/380bb7a3-cdcc-4336-a699-5070cbf521a5) | [Code](src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.php) | [Settings](src/380bb7a3-cdcc-4336-a699-5070cbf521a5/settings.json) | Super__380bb7a3_cdcc_4336_a699_5070cbf521a5__Power + - **class Load** | [Details](src/1f86db0f-e271-45df-8795-3e503ec76698) | [Code](src/1f86db0f-e271-45df-8795-3e503ec76698/code.php) | [Settings](src/1f86db0f-e271-45df-8795-3e503ec76698/settings.json) | Super__1f86db0f_e271_45df_8795_3e503ec76698__Power + - **class Update** | [Details](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3) | [Code](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.php) | [Settings](src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/settings.json) | Super__e543c123_b1d9_4a0b_83b2_a9d371da5ff3__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Power\Generator](#vdm-joomla-componentbuilder-power-generator) - **final class Bucket** | [Details](src/5d4278f0-7db2-498f-872a-c974bd8ce334) | [Code](src/5d4278f0-7db2-498f-872a-c974bd8ce334/code.php) | [Settings](src/5d4278f0-7db2-498f-872a-c974bd8ce334/settings.json) | Super__5d4278f0_7db2_498f_872a_c974bd8ce334__Power @@ -386,8 +416,8 @@ This repository contains an index (see below) of all the approved powers within - **final class ServiceProviderBuilder** | [Details](src/8a2a3ee5-6ce2-4604-91e2-01f770228960) | [Code](src/8a2a3ee5-6ce2-4604-91e2-01f770228960/code.php) | [Settings](src/8a2a3ee5-6ce2-4604-91e2-01f770228960/settings.json) | Super__8a2a3ee5_6ce2_4604_91e2_01f770228960__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Power\Model](#vdm-joomla-componentbuilder-power-model) - - **final class Load** | [Details](src/bb29a833-73f7-4283-9327-bc7e41f0723b) | [Code](src/bb29a833-73f7-4283-9327-bc7e41f0723b/code.php) | [Settings](src/bb29a833-73f7-4283-9327-bc7e41f0723b/settings.json) | Super__bb29a833_73f7_4283_9327_bc7e41f0723b__Power - - **final class Upsert** | [Details](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5) | [Code](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/code.php) | [Settings](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/settings.json) | Super__7c1fb50f_8fb1_4627_8705_6fedf7182ca5__Power + - **class Load** | [Details](src/bb29a833-73f7-4283-9327-bc7e41f0723b) | [Code](src/bb29a833-73f7-4283-9327-bc7e41f0723b/code.php) | [Settings](src/bb29a833-73f7-4283-9327-bc7e41f0723b/settings.json) | Super__bb29a833_73f7_4283_9327_bc7e41f0723b__Power + - **class Upsert** | [Details](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5) | [Code](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/code.php) | [Settings](src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/settings.json) | Super__7c1fb50f_8fb1_4627_8705_6fedf7182ca5__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Power\Service](#vdm-joomla-componentbuilder-power-service) - **class Database** | [Details](src/7243aaf6-b76c-4391-8698-50abbfc98fbe) | [Code](src/7243aaf6-b76c-4391-8698-50abbfc98fbe/code.php) | [Settings](src/7243aaf6-b76c-4391-8698-50abbfc98fbe/settings.json) | Super__7243aaf6_b76c_4391_8698_50abbfc98fbe__Power @@ -457,6 +487,10 @@ This repository contains an index (see below) of all the approved powers within - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model](#vdm-joomla-componentbuilder-compiler-interfaces-model) - **interface CustomtabsInterface** | [Details](src/fcf42c53-0967-4c87-9699-a4d86adfdadf) | [Code](src/fcf42c53-0967-4c87-9699-a4d86adfdadf/code.php) | [Settings](src/fcf42c53-0967-4c87-9699-a4d86adfdadf/settings.json) | Super__fcf42c53_0967_4c87_9699_a4d86adfdadf__Power +- **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power](#vdm-joomla-componentbuilder-compiler-interfaces-power) + + - **interface ExtractorInterface** | [Details](src/c159425c-51f9-4a15-af99-f2d0c6d7aae8) | [Code](src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/code.php) | [Settings](src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/settings.json) | Super__c159425c_51f9_4a15_af99_f2d0c6d7aae8__Power + - **interface InjectorInterface** | [Details](src/e923311a-4058-4e81-9f67-5956fd0c627c) | [Code](src/e923311a-4058-4e81-9f67-5956fd0c627c/code.php) | [Settings](src/e923311a-4058-4e81-9f67-5956fd0c627c/settings.json) | Super__e923311a_4058_4e81_9f67_5956fd0c627c__Power - **Namespace**: [VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFive](#vdm-joomla-componentbuilder-compiler-model-joomlafive) - **final class Customtabs** | [Details](src/92cc3144-1d3d-45b2-b49f-c7d356950033) | [Code](src/92cc3144-1d3d-45b2-b49f-c7d356950033/code.php) | [Settings](src/92cc3144-1d3d-45b2-b49f-c7d356950033/settings.json) | Super__92cc3144_1d3d_45b2_b49f_c7d356950033__Power diff --git a/src/05744dd3-4030-4cf8-8dda-a93ab809b473/README.md b/src/05744dd3-4030-4cf8-8dda-a93ab809b473/README.md new file mode 100644 index 0000000..a2364cf --- /dev/null +++ b/src/05744dd3-4030-4cf8-8dda-a93ab809b473/README.md @@ -0,0 +1,38 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Load (Details) +> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower\Model** +> extends: **Load** +```uml +@startuml +class Load << (F,LightGreen) >> #RoyalBlue { + # getTable() : string +} + +note right of Load::getTable + Get the current active table + + since: 3.2.0 + return: string +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/05744dd3-4030-4cf8-8dda-a93ab809b473/code.php b/src/05744dd3-4030-4cf8-8dda-a93ab809b473/code.php new file mode 100644 index 0000000..62a1996 --- /dev/null +++ b/src/05744dd3-4030-4cf8-8dda-a93ab809b473/code.php @@ -0,0 +1,37 @@ + + * @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\JoomlaPower\Model; + + +use VDM\Joomla\Interfaces\ModelInterface; +use VDM\Joomla\Componentbuilder\Power\Model\Load; + + +/** + * Joomla Power Model Load + * + * @since 3.2.0 + */ +final class Load extends Load implements ModelInterface +{ + /** + * Get the current active table + * + * @return string + * @since 3.2.0 + */ + protected function getTable(): string + { + return 'joomla_power'; + } +} + diff --git a/src/05744dd3-4030-4cf8-8dda-a93ab809b473/code.power b/src/05744dd3-4030-4cf8-8dda-a93ab809b473/code.power new file mode 100644 index 0000000..6be7a5e --- /dev/null +++ b/src/05744dd3-4030-4cf8-8dda-a93ab809b473/code.power @@ -0,0 +1,10 @@ + /** + * Get the current active table + * + * @return string + * @since 3.2.0 + */ + protected function getTable(): string + { + return 'joomla_power'; + } \ No newline at end of file diff --git a/src/05744dd3-4030-4cf8-8dda-a93ab809b473/settings.json b/src/05744dd3-4030-4cf8-8dda-a93ab809b473/settings.json new file mode 100644 index 0000000..afef44e --- /dev/null +++ b/src/05744dd3-4030-4cf8-8dda-a93ab809b473/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "bb29a833-73f7-4283-9327-bc7e41f0723b", + "guid": "05744dd3-4030-4cf8-8dda-a93ab809b473", + "implements": [ + "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff" + ], + "load_selection": null, + "name": "Load", + "power_version": "1.0.0", + "system_name": "JCB.JoomlaPower.Model.Load", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Model.Load", + "description": "Joomla Power Model Load\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/src/1f86db0f-e271-45df-8795-3e503ec76698/README.md b/src/1f86db0f-e271-45df-8795-3e503ec76698/README.md index f5510cd..878976a 100644 --- a/src/1f86db0f-e271-45df-8795-3e503ec76698/README.md +++ b/src/1f86db0f-e271-45df-8795-3e503ec76698/README.md @@ -6,13 +6,14 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# final class Load (Details) +# class Load (Details) > namespace: **VDM\Joomla\Componentbuilder\Power\Database** ```uml @startuml -class Load << (F,LightGreen) >> #RoyalBlue { +class Load #Gold { # Model $model # Database $load + # string $table + __construct(Model $model, Database $load) + value(array $keys, string $field) : mixed + item(array $keys) : ?object diff --git a/src/1f86db0f-e271-45df-8795-3e503ec76698/code.php b/src/1f86db0f-e271-45df-8795-3e503ec76698/code.php index 778fdf1..577d8ab 100644 --- a/src/1f86db0f-e271-45df-8795-3e503ec76698/code.php +++ b/src/1f86db0f-e271-45df-8795-3e503ec76698/code.php @@ -12,8 +12,9 @@ namespace VDM\Joomla\Componentbuilder\Power\Database; -use VDM\Joomla\Componentbuilder\Power\Model\Load as Model; +use VDM\Joomla\Interfaces\ModelInterface as Model; use VDM\Joomla\Database\Load as Database; +use VDM\Joomla\Componentbuilder\Power\Database\LoadInterface; /** @@ -21,7 +22,7 @@ use VDM\Joomla\Database\Load as Database; * * @since 2.0.1 */ -final class Load +class Load implements LoadInterface { /** * Model Load @@ -39,6 +40,14 @@ final class Load */ protected Database $load; + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'power'; + /** * Constructor * @@ -74,11 +83,11 @@ final class Load return $this->model->value( $this->load->value( ["a.{$field}" => $field], - ['a' => 'power'], + ['a' => $this->table], $this->prefix($keys) ), $field, - 'power' + $this->table ); } @@ -101,10 +110,10 @@ final class Load return $this->model->item( $this->load->item( ['all' => 'a.*'], - ['a' => 'power'], + ['a' => $this->table], $this->prefix($keys) ), - 'power' + $this->table ); } @@ -130,9 +139,9 @@ final class Load { return $this->model->items( $this->load->items( - ['all' => 'a.*'], ['a' => 'power'], $this->prefix($keys) + ['all' => 'a.*'], ['a' => $this->table], $this->prefix($keys) ), - 'power' + $this->table ); } diff --git a/src/1f86db0f-e271-45df-8795-3e503ec76698/code.power b/src/1f86db0f-e271-45df-8795-3e503ec76698/code.power index 3db4317..baac120 100644 --- a/src/1f86db0f-e271-45df-8795-3e503ec76698/code.power +++ b/src/1f86db0f-e271-45df-8795-3e503ec76698/code.power @@ -14,6 +14,14 @@ */ protected Database $load; + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'power'; + /** * Constructor * @@ -49,11 +57,11 @@ return $this->model->value( $this->load->value( ["a.{$field}" => $field], - ['a' => 'power'], + ['a' => $this->table], $this->prefix($keys) ), $field, - 'power' + $this->table ); } @@ -76,10 +84,10 @@ return $this->model->item( $this->load->item( ['all' => 'a.*'], - ['a' => 'power'], + ['a' => $this->table], $this->prefix($keys) ), - 'power' + $this->table ); } @@ -105,9 +113,9 @@ { return $this->model->items( $this->load->items( - ['all' => 'a.*'], ['a' => 'power'], $this->prefix($keys) + ['all' => 'a.*'], ['a' => $this->table], $this->prefix($keys) ), - 'power' + $this->table ); } diff --git a/src/1f86db0f-e271-45df-8795-3e503ec76698/settings.json b/src/1f86db0f-e271-45df-8795-3e503ec76698/settings.json index 7d5cc31..91a10e7 100644 --- a/src/1f86db0f-e271-45df-8795-3e503ec76698/settings.json +++ b/src/1f86db0f-e271-45df-8795-3e503ec76698/settings.json @@ -3,15 +3,17 @@ "add_licensing_template": "2", "extends": "0", "guid": "1f86db0f-e271-45df-8795-3e503ec76698", - "implements": null, + "implements": [ + "99786f53-64b7-4d52-95b0-5306e7386c3f" + ], "load_selection": null, "name": "Load", "power_version": "1.0.0", "system_name": "JCB.Power.Database.Load", - "type": "final class", + "type": "class", "use_selection": { "use_selection0": { - "use": "bb29a833-73f7-4283-9327-bc7e41f0723b", + "use": "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff", "as": "Model" }, "use_selection1": { diff --git a/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/README.md b/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/README.md new file mode 100644 index 0000000..4f7ad7e --- /dev/null +++ b/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/README.md @@ -0,0 +1,62 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Grep (Details) +> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower** +> extends: **Grep** +```uml +@startuml +class Grep << (F,LightGreen) >> #RoyalBlue { + - getLocal(object $path, string $guid) : ?object + - getRemote(object $path, string $guid) : ?object + - localIndex(object $path) : void + - remoteIndex(object $path) : void +} + +note right of Grep::getLocal + Get a local power + + since: 3.2.0 + return: ?object +end note + +note right of Grep::getRemote + Get a remote power + + since: 3.2.0 + return: ?object +end note + +note right of Grep::localIndex + Load the local repository index of powers + + since: 3.2.0 + return: void +end note + +note right of Grep::remoteIndex + Load the remote repository index of powers + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/code.php b/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/code.php new file mode 100644 index 0000000..8f1e9f3 --- /dev/null +++ b/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/code.php @@ -0,0 +1,146 @@ + + * @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\JoomlaPower; + + +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Componentbuilder\Interfaces\GrepInterface; +use VDM\Joomla\Componentbuilder\Power\Grep; + + +/** + * Global Resource Empowerment Platform + * + * The Grep feature will try to find your joomla power in the repositories listed in the global + * Options of JCB in the super powers tab, and if it can't be found there will try the global core + * Super powers of JCB. All searches are performed according the the [algorithm:cascading] + * See documentation for more details: https://git.vdm.dev/joomla/super-powers/wiki + * + * @since 3.2.1 + */ +final class Grep extends Grep implements GrepInterface +{ + /** + * Get a local power + * + * @param object $path The repository path details + * @param string $guid The global unique id of the power + * + * @return object|null + * @since 3.2.0 + */ + private function getLocal(object $path, string $guid): ?object + { + if (empty($path->local->{$guid}->settings)) + { + return null; + } + + // get the settings + if (($settings = FileHelper::getContent($path->full_path . '/' . $path->local->{$guid}->settings, null)) !== null && + JsonHelper::check($settings)) + { + $power = json_decode($settings); + + if (isset($power->guid)) + { + return $power; + } + } + + return null; + } + + /** + * Get a remote power + * + * @param object $path The repository path details + * @param string $guid The global unique id of the power + * + * @return object|null + * @since 3.2.0 + */ + private function getRemote(object $path, string $guid): ?object + { + if (empty($path->index->{$guid}->settings)) + { + return null; + } + + // get the settings + if (($power = $this->loadRemoteFile($path->owner, $path->repo, $path->index->{$guid}->settings, $path->branch)) !== null && + isset($power->guid)) + { + return $power; + } + + return null; + } + + /** + * Load the local repository index of powers + * + * @param object $path The repository path details + * + * @return void + * @since 3.2.0 + */ + private function localIndex(object &$path) + { + if (isset($path->local) || !isset($path->full_path)) + { + return; + } + + if (($content = FileHelper::getContent($path->full_path . '/joomla-powers.json', null)) !== null && + JsonHelper::check($content)) + { + $path->local = json_decode($content); + + return; + } + + $path->local = null; + } + + /** + * Load the remote repository index of powers + * + * @param object $path The repository path details + * + * @return void + * @since 3.2.0 + */ + private function remoteIndex(object &$path) + { + if (isset($path->index)) + { + return; + } + + try + { + $path->index = $this->contents->get($path->owner, $path->repo, 'joomla-powers.json', $path->branch); + } + catch (\Exception $e) + { + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $this->contents->api(), $path->path, $e->getMessage()), + 'Error' + ); + + $path->index = null; + } + } +} + diff --git a/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/code.power b/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/code.power new file mode 100644 index 0000000..009ffc9 --- /dev/null +++ b/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/code.power @@ -0,0 +1,112 @@ + /** + * Get a local power + * + * @param object $path The repository path details + * @param string $guid The global unique id of the power + * + * @return object|null + * @since 3.2.0 + */ + private function getLocal(object $path, string $guid): ?object + { + if (empty($path->local->{$guid}->settings)) + { + return null; + } + + // get the settings + if (($settings = FileHelper::getContent($path->full_path . '/' . $path->local->{$guid}->settings, null)) !== null && + JsonHelper::check($settings)) + { + $power = json_decode($settings); + + if (isset($power->guid)) + { + return $power; + } + } + + return null; + } + + /** + * Get a remote power + * + * @param object $path The repository path details + * @param string $guid The global unique id of the power + * + * @return object|null + * @since 3.2.0 + */ + private function getRemote(object $path, string $guid): ?object + { + if (empty($path->index->{$guid}->settings)) + { + return null; + } + + // get the settings + if (($power = $this->loadRemoteFile($path->owner, $path->repo, $path->index->{$guid}->settings, $path->branch)) !== null && + isset($power->guid)) + { + return $power; + } + + return null; + } + + /** + * Load the local repository index of powers + * + * @param object $path The repository path details + * + * @return void + * @since 3.2.0 + */ + private function localIndex(object &$path) + { + if (isset($path->local) || !isset($path->full_path)) + { + return; + } + + if (($content = FileHelper::getContent($path->full_path . '/joomla-powers.json', null)) !== null && + JsonHelper::check($content)) + { + $path->local = json_decode($content); + + return; + } + + $path->local = null; + } + + /** + * Load the remote repository index of powers + * + * @param object $path The repository path details + * + * @return void + * @since 3.2.0 + */ + private function remoteIndex(object &$path) + { + if (isset($path->index)) + { + return; + } + + try + { + $path->index = $this->contents->get($path->owner, $path->repo, 'joomla-powers.json', $path->branch); + } + catch (\Exception $e) + { + $this->app->enqueueMessage( + Text::sprintf('

Super Power repository at %s/%s gave the following error!
%s

', $this->contents->api(), $path->path, $e->getMessage()), + 'Error' + ); + + $path->index = null; + } + } \ No newline at end of file diff --git a/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/settings.json b/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/settings.json new file mode 100644 index 0000000..860a6b5 --- /dev/null +++ b/src/355bf21a-f859-4528-9110-bcd2c6d05ea7/settings.json @@ -0,0 +1,29 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "6784dd52-0909-451a-a872-9a942a023c68", + "guid": "355bf21a-f859-4528-9110-bcd2c6d05ea7", + "implements": [ + "c182506a-ab84-439c-b962-1e606b58d545" + ], + "load_selection": null, + "name": "Grep", + "power_version": "1.0.0", + "system_name": "JCB.JoomlaPower.Grep", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0", + "as": "default" + }, + "use_selection1": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Grep", + "description": "Global Resource Empowerment Platform\r\n\r\n The Grep feature will try to find your joomla power in the repositories listed in the global\r\n Options of JCB in the super powers tab, and if it can't be found there will try the global core\r\n Super powers of JCB. All searches are performed according the the [algorithm:cascading]\r\n See documentation for more details: https:\/\/git.vdm.dev\/joomla\/super-powers\/wiki\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": "" +} \ No newline at end of file diff --git a/src/3730a000-ab64-477d-8b0f-70eaf71b517a/README.md b/src/3730a000-ab64-477d-8b0f-70eaf71b517a/README.md new file mode 100644 index 0000000..bc0d499 --- /dev/null +++ b/src/3730a000-ab64-477d-8b0f-70eaf71b517a/README.md @@ -0,0 +1,227 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class JoomlaPower (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler** +```uml +@startuml +class JoomlaPower << (F,LightGreen) >> #RoyalBlue { + + array $active + + array $namespace + + array $composer + + array $superpowers + # string $fixUrl + # array $state + # array $retry + # Config $config + # Placeholder $placeholder + # Customcode $customcode + # Gui $gui + # Superpower $superpower + # $db + # $app + + __construct(Config $config, Placeholder $placeholder, ...) + + load(array $guids) : void + + get(string $guid, int $build) : ?object + - set(string $guid) : bool + - isPowerSet(string $guid) : bool + - isGuidValid(string $guid) : bool + - getPowerData(string $guid) : ?object + - setNamespace(string $guid) : bool + - setUseSelection(string $guid, array $use, ...) : void + - setLoadSelection(string $guid) : void + - setComposer(string $guid) : void + - setImplements(string $guid, array $use) : void + - setExtend(string $guid, array $use) : void + - setUseAs(string $guid, array $use, ...) : void + - getCleanNamespace(string $namespace) : string + - getUseNamespace(string $namespace, string $as = 'default') : string + - addToHeader(string $guid, string $string) : void + - setLicensingTemplate(string $guid, array $guiMapper) : void + - setHeader(string $guid, array $guiMapper) : void + - setMainClassCode(string $guid, array $guiMapper) : void + - setSuperPowers(string $guid) : void +} + +note right of JoomlaPower::__construct + Constructor. + + since: 3.2.0 + + arguments: + Config $config + Placeholder $placeholder + Customcode $customcode + Gui $gui + Superpower $superpower +end note + +note left of JoomlaPower::load + load all the powers linked to this component + + since: 3.2.0 + return: void +end note + +note right of JoomlaPower::get + Get a power + + since: 3.2.0 + return: ?object +end note + +note left of JoomlaPower::set + Set a power + + since: 3.2.0 + return: bool +end note + +note right of JoomlaPower::isPowerSet + Check if the power is already set + + since: 3.2.0 + return: bool +end note + +note left of JoomlaPower::isGuidValid + Validate the GUID + + since: 3.2.0 + return: bool +end note + +note right of JoomlaPower::getPowerData + Get the power data from the database + + since: 3.2.0 + return: ?object +end note + +note left of JoomlaPower::setNamespace + Set the namespace for this power + + since: 3.2.0 + return: bool +end note + +note right of JoomlaPower::setUseSelection + Set Use Classes + + since: 3.2.0 + return: void + + arguments: + string $guid + array $use + array $as +end note + +note left of JoomlaPower::setLoadSelection + Load Extra Classes + + since: 3.2.0 + return: void +end note + +note right of JoomlaPower::setComposer + Set Composer Linked Use and Access Point + + since: 3.2.0 + return: void +end note + +note left of JoomlaPower::setImplements + Set Implements Interface classes + + since: 3.2.0 + return: void +end note + +note right of JoomlaPower::setExtend + Set Extend Class + + since: 3.2.0 + return: void +end note + +note left of JoomlaPower::setUseAs + Set Extra Use Classes + + since: 3.2.0 + return: void + + arguments: + string $guid + array $use + array $as +end note + +note right of JoomlaPower::getCleanNamespace + Get Clean Namespace without use or ; as part of the name space + + since: 3.2.0 + return: string +end note + +note left of JoomlaPower::getUseNamespace + Get [use Namespace\Class;] + + since: 3.2.0 + return: string +end note + +note right of JoomlaPower::addToHeader + Add to class header + + since: 3.2.0 + return: void +end note + +note left of JoomlaPower::setLicensingTemplate + Set the power licensing template + + since: 3.2.0 + return: void +end note + +note right of JoomlaPower::setHeader + Set the power header script + + since: 3.2.0 + return: void +end note + +note left of JoomlaPower::setMainClassCode + Set the power main class code + + since: 3.2.0 + return: void +end note + +note right of JoomlaPower::setSuperPowers + Set the super powers of this power + + since: 3.2.0 + return: void +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/3730a000-ab64-477d-8b0f-70eaf71b517a/code.php b/src/3730a000-ab64-477d-8b0f-70eaf71b517a/code.php new file mode 100644 index 0000000..51a6037 --- /dev/null +++ b/src/3730a000-ab64-477d-8b0f-70eaf71b517a/code.php @@ -0,0 +1,1068 @@ + + * @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\Compiler; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\GuidHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\String\NamespaceHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\JoomlaPower\Super as SuperPower; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\PowerInterface; + + +/** + * Power + */ +final class JoomlaPower implements PowerInterface +{ + /** + * All loaded powers + * + * @var array + * @since 3.2.0 + **/ + public array $active = []; + + /** + * All power namespaces + * + * @var array + * @since 3.2.0 + **/ + public array $namespace = []; + + /** + * All composer namespaces + * + * @var array + * @since 3.2.0 + **/ + public array $composer = []; + + /** + * All super powers of this build + * + * @var array + * @since 3.2.0 + **/ + public array $superpowers = []; + + /** + * Old super powers found in the local repos + * + * @var array + * @since 3.2.0 + **/ + public array $old_superpowers = []; + + /** + * The url to the power, if there is an error. + * + * @var string + * @since 3.2.0 + **/ + protected string $fixUrl; + + /** + * The state of all loaded powers + * + * @var array + * @since 3.2.0 + **/ + protected array $state = []; + + /** + * The state of retry to loaded powers + * + * @var array + * @since 3.2.0 + **/ + protected array $retry = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + **/ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * The JCB Superpower class + * + * @var Superpower + * @since 3.2.0 + **/ + protected Superpower $superpower; + + /** + * Database object to query local DB + * + * @since 3.2.0 + **/ + protected $db; + + /** + * Database object to query local DB + * + * @since 3.2.0 + **/ + protected $app; + + /** + * Constructor. + * + * @param Config $config The compiler config object. + * @param Placeholder $placeholder The compiler placeholder object. + * @param Customcode $customcode The compiler customcode object. + * @param Gui $gui The compiler customcode gui object. + * @param Superpower $superpower The JCB superpower object. + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(Config $config, Placeholder $placeholder, + Customcode $customcode, Gui $gui, Superpower $superpower) + { + $this->config = $config; + $this->placeholder = $placeholder; + $this->customcode = $customcode; + $this->gui = $gui; + $this->superpower = $superpower; + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); + } + + /** + * load all the powers linked to this component + * + * @param array $guids The global unique ids of the linked powers + * + * @return void + * @since 3.2.0 + */ + public function load(array $guids) + { + if (ArrayHelper::check($guids)) + { + foreach ($guids as $guid => $build) + { + $this->get($guid, $build); + } + } + } + + /** + * Get a power + * + * @param string $guid The global unique id of the power + * @param int $build Force build switch (to override global switch) + * + * @return object|null + * @since 3.2.0 + */ + public function get(string $guid, int $build = 0): ?object + { + if (($this->config->get('add_power', true) || $build == 1) && $this->set($guid)) + { + return $this->active[$guid]; + } + + return null; + } + + /** + * Set a power + * + * @param string $guid The global unique id of the power + * + * @return bool true on successful setting of a power + * @since 3.2.0 + */ + private function set(string $guid): bool + { + // check if we have been here before + if ($this->isPowerSet($guid)) + { + return $this->state[$guid]; + } + elseif ($this->isGuidValid($guid)) + { + // get the power data + $this->active[$guid] = $this->getPowerData($guid); + + if (is_object($this->active[$guid])) + { + // make sure that in recursion we + // don't try to load this power again + // since during the load of a power we also load + // all powers linked to it + $this->state[$guid] = true; + + // make sure to add any language strings found to all language files + // since we can't know where this is used at this point + $tmp_lang_target = $this->config->lang_target; + $this->config->lang_target = 'both'; + + // we set the fix url if needed + $this->fixUrl + = '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id=' + . $this->active[$guid]->id . '" target="_blank"'; + + // set some keys + $this->active[$guid]->target_type = 'P0m3R!'; + $this->active[$guid]->key = $this->active[$guid]->id . '_' . $this->active[$guid]->target_type; + + // reserve some values for the linker + $this->active[$guid]->unchanged_namespace = $this->active[$guid]->namespace; + $this->active[$guid]->unchanged_description = $this->active[$guid]->description; + + // now set the name + $this->active[$guid]->name = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->name) + ); + + // now set the code_name and class name + $this->active[$guid]->code_name = $this->active[$guid]->class_name = ClassfunctionHelper::safe( + $this->active[$guid]->name + ); + + // set official name + $this->active[$guid]->official_name = StringHelper::safe( + $this->active[$guid]->name, 'W' + ); + + // set name space + if (!$this->setNamespace($guid)) + { + $this->state[$guid] = false; + unset($this->active[$guid]); + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + + return false; + } + + // load use ids + $use = []; + $as = []; + + // set extra classes + $this->setLoadSelection($guid); + + // set use classes + $this->setUseSelection($guid, $use, $as); + + // set implement interfaces + $this->setImplements($guid, $use); + + // set extend class + $this->setExtend($guid, $use); + + // set GUI mapper + $guiMapper = [ + 'table' => 'power', + 'id' => (int) $this->active[$guid]->id, + 'type' => 'php' + ]; + + // add the licensing template + $this->setLicensingTemplate($guid, $guiMapper); + + // add the header script + $this->setHeader($guid, $guiMapper); + + // set composer + $this->setComposer($guid); + + // now set the description + $this->active[$guid]->description = (StringHelper::check($this->active[$guid]->description)) ? $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->description), + ) : ''; + + // add the main code if set + $this->setMainClassCode($guid, $guiMapper); + + // load the use classes + $this->setUseAs($guid, $use, $as); + + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + + // set the approved super power values + $this->setSuperPowers($guid); + + return true; + } + } + + // we failed to get the power, + // so we raise an error message + // only if guid is valid + if ($this->isGuidValid($guid)) + { + // now we search for it via the super power paths + if (empty($this->retry[$guid]) && $this->superpower->load($guid, ['remote', 'local'])) + { + // we found it and it was loaded into the database + unset($this->state[$guid]); + unset($this->active[$guid]); + + // we make sure that this retry only happen once! (just in-case...) + $this->retry[$guid] = true; + + // so we try to load it again + return $this->set($guid); + } + + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP', $guid), + 'Error' + ); + } + + // let's not try again + $this->state[$guid] = false; + + return false; + } + + /** + * Check if the power is already set + * + * @param string $guid The global unique id of the power + * + * @return bool true if the power is already set + * @since 3.2.0 + */ + private function isPowerSet(string $guid): bool + { + return isset($this->state[$guid]); + } + + /** + * Validate the GUID + * + * @param string $guid The global unique id of the power + * + * @return bool true if the GUID is valid + * @since 3.2.0 + */ + private function isGuidValid(string $guid): bool + { + return GuidHelper::valid($guid); + } + + /** + * Get the power data from the database + * + * @param string $guid The global unique id of the power + * + * @return object|null The power data + * @since 3.2.0 + */ + private function getPowerData(string $guid): ?object + { + $query = $this->db->getQuery(true); + $query->select('a.*'); + $query->from('#__componentbuilder_power AS a'); + $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); + + $this->db->setQuery($query); + $this->db->execute(); + + if ($this->db->getNumRows()) + { + return $this->db->loadObject(); + } + + return null; + } + + /** + * Set the namespace for this power + * + * @param string $guid The global unique id of the power + * + * @return bool + * @since 3.2.0 + */ + private function setNamespace(string $guid): bool + { + // set namespace + $this->active[$guid]->namespace = $this->placeholder->update_( + $this->active[$guid]->namespace + ); + + // validate namespace + if (strpos($this->active[$guid]->namespace, '\\') === false) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->namespace, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $this->active[$guid]->type, + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // setup the path array + $path_array = (array) explode('\\', $this->active[$guid]->namespace); + + // make sure all sub folders in src dir is set and remove all characters that will not work in folders naming + $this->active[$guid]->namespace = $this->getCleanNamespace(str_replace('.', '\\', $this->active[$guid]->namespace)); + + // make sure it has two or more + if (ArrayHelper::check($path_array) <= 1) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->namespace, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $this->active[$guid]->type, + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // get the file and class name (the last value in array) + $file_name = array_pop($path_array); + + // src array bucket + $src_array = []; + + // do we have src folders + if (strpos($file_name, '.') !== false) + { + // we have src folders in the namespace + $src_array = (array) explode('.', $file_name); + + // get the file and class name (the last value in array) + $this->active[$guid]->file_name = array_pop($src_array); + + // namespace array + $namespace_array = [...$path_array, ...$src_array]; + } + else + { + // set the file name + $this->active[$guid]->file_name = $file_name; + + // namespace array + $namespace_array = $path_array; + } + + // the last value is the same as the class name + if ($this->active[$guid]->file_name !== $this->active[$guid]->class_name) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_PS_NAMING_MISMATCH_ERROR_SPPTHE_S_NAME_IS_BSB_AND_THE_ENDING_FILE_NAME_IN_THE_NAMESPACE_IS_BSB_THIS_IS_BAD_CONVENTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPA_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->type, $this->active[$guid]->class_name, $this->active[$guid]->file_name, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // make sure the arrays are namespace safe + $path_array = + array_map( + fn($val) => $this->getCleanNamespace($val), + $path_array + ); + $namespace_array = + array_map( + fn($val) => $this->getCleanNamespace($val), + $namespace_array + ); + + // set the actual class namespace + $this->active[$guid]->_namespace = implode('\\', $namespace_array); + + // set global namespaces for autoloader + $this->namespace[implode('.', $path_array)] = $path_array; + + // get the parent folder (the first value in array) + $prefix_folder = implode('.', $path_array); + + // make sub folders if still found + $sub_folder = ''; + if (ArrayHelper::check($src_array)) + { + // make sure the arrays are namespace safe + $sub_folder = '/' . implode('/', + array_map( + fn($val) => $this->getCleanNamespace($val), + $src_array + ) + ); + } + + // now we set the paths + $this->active[$guid]->path_jcb = $this->config->get('jcb_powers_path', 'libraries/jcb_powers'); + $this->active[$guid]->path_parent = $this->active[$guid]->path_jcb . '/' . $prefix_folder; + $this->active[$guid]->path = $this->active[$guid]->path_parent . '/src' . $sub_folder; + + return true; + } + + /** + * Set Use Classes + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * @param array $as The use as array + * + * @return void + * @since 3.2.0 + */ + private function setUseSelection(string $guid, array &$use, array &$as) + { + // check if we have use selection + $this->active[$guid]->use_selection = (isset($this->active[$guid]->use_selection) + && JsonHelper::check( + $this->active[$guid]->use_selection + )) ? json_decode((string) $this->active[$guid]->use_selection, true) : null; + + if (ArrayHelper::check($this->active[$guid]->use_selection)) + { + $use = array_values(array_map(function ($u) use(&$as) { + // track the AS options + $as[$u['use']] = empty($u['as']) ? 'default' : (string) $u['as']; + // return the guid + return $u['use']; + }, $this->active[$guid]->use_selection)); + } + else + { + $this->active[$guid]->use_selection = null; + } + } + + /** + * Load Extra Classes + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setLoadSelection(string $guid) + { + // check if we have load selection + $this->active[$guid]->load_selection = (isset($this->active[$guid]->load_selection) + && JsonHelper::check( + $this->active[$guid]->load_selection + )) ? json_decode((string) $this->active[$guid]->load_selection, true) : null; + + if (ArrayHelper::check($this->active[$guid]->load_selection)) + { + // load use ids + array_map( + // just load it directly and be done with it + fn($power) => $this->set($power['load']), + $this->active[$guid]->load_selection + ); + } + else + { + $this->active[$guid]->load_selection = null; + } + } + + /** + * Set Composer Linked Use and Access Point + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setComposer(string $guid) + { + // does this have composer powers + $_composer = (isset($this->active[$guid]->composer) + && JsonHelper::check( + $this->active[$guid]->composer + )) ? json_decode((string) $this->active[$guid]->composer, true) : null; + + unset($this->active[$guid]->composer); + + if (ArrayHelper::check($_composer)) + { + // reserve composer values for the linker + $this->active[$guid]->unchanged_composer = $_composer; + + foreach ($_composer as $composer) + { + if (isset($composer['access_point']) && StringHelper::check($composer['access_point']) && + isset($composer['namespace']) && ArrayHelper::check($composer['namespace'])) + { + foreach ($composer['namespace'] as $_namespace) + { + // make sure we have a valid namespace + if (isset($_namespace['use']) && StringHelper::check($_namespace['use']) && + strpos((string) $_namespace['use'], '\\') !== false) + { + // add the namespace to this access point + $as = 'default'; + if (strpos((string) $_namespace['use'], ' as ') !== false) + { + $namespace_as = explode(' as ', (string) $_namespace['use']); + // make sure the AS value is set + if (count($namespace_as) == 2) + { + $as = trim(trim($namespace_as[1], ';')); + } + $namespace = $this->getCleanNamespace($namespace_as[0]); + } + else + { + // trim possible use or ; added to the namespace + $namespace = $this->getCleanNamespace($_namespace['use']); + } + + // check if still valid + if (!StringHelper::check($namespace)) + { + continue; + } + + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace, $as)); + + // add composer namespaces for autoloader + $this->composer[$namespace] = $composer['access_point']; + } + } + } + } + } + else + { + // reserve composer values for the linker + $this->active[$guid]->unchanged_composer = ''; + } + } + + /** + * Set Implements Interface classes + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * + * @return void + * @since 3.2.0 + */ + private function setImplements(string $guid, array &$use) + { + // see if we have implements + $this->active[$guid]->implement_names = []; + + // does this implement + $this->active[$guid]->implements = (isset($this->active[$guid]->implements) + && JsonHelper::check( + $this->active[$guid]->implements + )) ? json_decode((string) $this->active[$guid]->implements, true) : null; + + if ($this->active[$guid]->implements) + { + foreach ($this->active[$guid]->implements as $implement) + { + if ($implement == -1 + && StringHelper::check($this->active[$guid]->implements_custom)) + { + // reserve implements custom for the linker + $this->active[$guid]->unchanged_implements_custom = $this->active[$guid]->implements_custom; + + $this->active[$guid]->implement_names[] = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->implements_custom) + ); + + // just add this once + unset($this->active[$guid]->implements_custom); + } + // does this extend existing + elseif (GuidHelper::valid($implement)) + { + // check if it was set + if ($this->set($implement)) + { + // get the name + $this->active[$guid]->implement_names[] = $this->get($implement, 1)->class_name; + // add to use + $use[] = $implement; + } + } + } + } + } + + /** + * Set Extend Class + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * + * @return void + * @since 3.2.0 + */ + private function setExtend(string $guid, array &$use) + { + // does this extend something + $this->active[$guid]->extends_name = null; + + // we first check for custom extending options + if ($this->active[$guid]->extends == -1 + && StringHelper::check($this->active[$guid]->extends_custom)) + { + // reserve extends custom for the linker + $this->active[$guid]->unchanged_extends_custom = $this->active[$guid]->extends_custom; + + $this->active[$guid]->extends_name = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->extends_custom) + ); + + // just add once + unset($this->active[$guid]->extends_custom); + } + // does this extend existing + elseif (GuidHelper::valid($this->active[$guid]->extends)) + { + // check if it was set + if ($this->set($this->active[$guid]->extends)) + { + // get the name + $this->active[$guid]->extends_name = $this->get($this->active[$guid]->extends, 1)->class_name; + // add to use + $use[] = $this->active[$guid]->extends; + } + } + } + + /** + * Set Extra Use Classes + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * @param array $as The use as array + * + * @return void + * @since 3.2.0 + */ + private function setUseAs(string $guid, array $use, array $as) + { + // now add all the extra use statements + if (ArrayHelper::check($use)) + { + foreach (array_unique($use) as $u) + { + if ($this->set($u)) + { + // get the namespace + $namespace = $this->get($u, 1)->namespace; + + // check if it has an AS option + if (isset($as[$u]) && StringHelper::check($as[$u])) + { + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace, $as[$u])); + } + else + { + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace)); + } + } + } + } + } + + /** + * Get Clean Namespace without use or ; as part of the name space + * + * @param string $namespace The actual name space + * @param bool $removeNumbers The switch to remove numbers + * + * @return string + * @since 3.2.0 + */ + private function getCleanNamespace(string $namespace): string + { + // trim possible (use) or (;) or (starting or ending \) added to the namespace + return NamespaceHelper::safe(str_replace(['use ', ';'], '', $namespace)); + } + + /** + * Get [use Namespace\Class;] + * + * @param string $namespace The actual name space + * @param string $as The use as name (default is none) + * + * @return string + * @since 3.2.0 + */ + private function getUseNamespace(string $namespace, string $as = 'default'): string + { + // check if it has an AS option + if ($as !== 'default') + { + return 'use ' . $namespace . ' as ' . $as . ';'; + } + return 'use ' . $namespace . ';'; + } + + /** + * Add to class header + * + * @param string $guid The global unique id of the power + * @param string $string The string to add to header + * + * @return void + * @since 3.2.0 + */ + private function addToHeader(string $guid, string $string) + { + // check if it is already added manually + if (isset($this->active[$guid]->head) && + strpos((string) $this->active[$guid]->head, $string) === false) + { + $this->active[$guid]->head .= $string . PHP_EOL; + } + } + + /** + * Set the power licensing template + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setLicensingTemplate(string $guid, array $guiMapper): void + { + if ($this->active[$guid]->add_licensing_template == 2 && + StringHelper::check($this->active[$guid]->licensing_template)) + { + // set GUI mapper field + $guiMapper['field'] = 'licensing_template'; + + // reserve licensing template for the linker + $this->active[$guid]->unchanged_licensing_template = base64_decode( + (string) $this->active[$guid]->licensing_template + ); + + // base64 Decode code + $this->active[$guid]->licensing_template = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + $this->active[$guid]->unchanged_licensing_template + ) + ), + $guiMapper + ); + } + else + { + $this->active[$guid]->add_licensing_template = 1; + $this->active[$guid]->licensing_template = ''; + $this->active[$guid]->unchanged_licensing_template = ''; + } + } + + /** + * Set the power header script + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setHeader(string $guid, array $guiMapper): void + { + if ($this->active[$guid]->add_head == 1) + { + // set GUI mapper field + $guiMapper['field'] = 'head'; + + // reserve header for the linker + $this->active[$guid]->unchanged_head = base64_decode( + (string) $this->active[$guid]->head + ); + + // base64 Decode code + $this->active[$guid]->head = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + $this->active[$guid]->unchanged_head + ) + ), + $guiMapper + ) . PHP_EOL; + } + else + { + $this->active[$guid]->head = ''; + $this->active[$guid]->unchanged_head = ''; + } + } + + /** + * Set the power main class code + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setMainClassCode(string $guid, array $guiMapper): void + { + if (StringHelper::check($this->active[$guid]->main_class_code)) + { + // reserve main class code for the linker + $this->active[$guid]->unchanged_main_class_code = base64_decode( + (string) $this->active[$guid]->main_class_code + ); + + // set GUI mapper field + $guiMapper['field'] = 'main_class_code'; + + // base64 Decode code + $this->active[$guid]->main_class_code = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + $this->active[$guid]->unchanged_main_class_code + ) + ), + $guiMapper + ); + } + else + { + $this->active[$guid]->unchanged_main_class_code = ''; + $this->active[$guid]->main_class_code = ''; + } + } + + /** + * Set the super powers of this power + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setSuperPowers(string $guid): void + { + // set the approved super power values + if ($this->config->add_super_powers && $this->active[$guid]->approved == 1) + { + $this->active[$guid]->approved_paths = (isset($this->active[$guid]->approved_paths) + && JsonHelper::check( + $this->active[$guid]->approved_paths + )) ? json_decode((string) $this->active[$guid]->approved_paths, true) : null; + + if (ArrayHelper::check($this->active[$guid]->approved_paths)) + { + $global_path = $this->config->local_powers_repository_path; + + // update all paths + $this->active[$guid]->super_power_paths = array_map(function($path) use($global_path, $guid) { + + // remove branch + if (($pos = strpos($path, ':')) !== false) + { + $path = substr($path, 0, $pos); + } + + // set the repo path + $repo = $global_path . '/' . $path; + + // set SuperPowerKey (spk) + $spk = 'Super_'.'_' . str_replace('-', '_', $guid) . '_'.'_Power'; + + // set the global super power + $this->superpowers[$repo][$guid] = [ + 'name' => $this->active[$guid]->code_name, + 'type' => $this->active[$guid]->type, + 'namespace' => $this->active[$guid]->_namespace, + 'code' => 'src/' . $guid . '/code.php', + 'power' => 'src/' . $guid . '/code.power', + 'settings' => 'src/' . $guid . '/settings.json', + 'path' => 'src/' . $guid, + 'spk' => $spk, + 'guid' => $guid + ]; + + return $repo . '/src/' . $guid; + }, array_values($this->active[$guid]->approved_paths)); + + return; + } + } + + // reset all to avoid any misunderstanding down steam + $this->active[$guid]->super_power_paths = null; + $this->active[$guid]->approved_paths = null; + $this->active[$guid]->approved = null; + } +} + diff --git a/src/3730a000-ab64-477d-8b0f-70eaf71b517a/code.power b/src/3730a000-ab64-477d-8b0f-70eaf71b517a/code.power new file mode 100644 index 0000000..e211a70 --- /dev/null +++ b/src/3730a000-ab64-477d-8b0f-70eaf71b517a/code.power @@ -0,0 +1,1029 @@ + /** + * All loaded powers + * + * @var array + * @since 3.2.0 + **/ + public array $active = []; + + /** + * All power namespaces + * + * @var array + * @since 3.2.0 + **/ + public array $namespace = []; + + /** + * All composer namespaces + * + * @var array + * @since 3.2.0 + **/ + public array $composer = []; + + /** + * All super powers of this build + * + * @var array + * @since 3.2.0 + **/ + public array $superpowers = []; + + /** + * Old super powers found in the local repos + * + * @var array + * @since 3.2.0 + **/ + public array $old_superpowers = []; + + /** + * The url to the power, if there is an error. + * + * @var string + * @since 3.2.0 + **/ + protected string $fixUrl; + + /** + * The state of all loaded powers + * + * @var array + * @since 3.2.0 + **/ + protected array $state = []; + + /** + * The state of retry to loaded powers + * + * @var array + * @since 3.2.0 + **/ + protected array $retry = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + **/ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * The JCB Superpower class + * + * @var Superpower + * @since 3.2.0 + **/ + protected Superpower $superpower; + + /** + * Database object to query local DB + * + * @since 3.2.0 + **/ + protected $db; + + /** + * Database object to query local DB + * + * @since 3.2.0 + **/ + protected $app; + + /** + * Constructor. + * + * @param Config $config The compiler config object. + * @param Placeholder $placeholder The compiler placeholder object. + * @param Customcode $customcode The compiler customcode object. + * @param Gui $gui The compiler customcode gui object. + * @param Superpower $superpower The JCB superpower object. + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(Config $config, Placeholder $placeholder, + Customcode $customcode, Gui $gui, Superpower $superpower) + { + $this->config = $config; + $this->placeholder = $placeholder; + $this->customcode = $customcode; + $this->gui = $gui; + $this->superpower = $superpower; + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); + } + + /** + * load all the powers linked to this component + * + * @param array $guids The global unique ids of the linked powers + * + * @return void + * @since 3.2.0 + */ + public function load(array $guids) + { + if (ArrayHelper::check($guids)) + { + foreach ($guids as $guid => $build) + { + $this->get($guid, $build); + } + } + } + + /** + * Get a power + * + * @param string $guid The global unique id of the power + * @param int $build Force build switch (to override global switch) + * + * @return object|null + * @since 3.2.0 + */ + public function get(string $guid, int $build = 0): ?object + { + if (($this->config->get('add_power', true) || $build == 1) && $this->set($guid)) + { + return $this->active[$guid]; + } + + return null; + } + + /** + * Set a power + * + * @param string $guid The global unique id of the power + * + * @return bool true on successful setting of a power + * @since 3.2.0 + */ + private function set(string $guid): bool + { + // check if we have been here before + if ($this->isPowerSet($guid)) + { + return $this->state[$guid]; + } + elseif ($this->isGuidValid($guid)) + { + // get the power data + $this->active[$guid] = $this->getPowerData($guid); + + if (is_object($this->active[$guid])) + { + // make sure that in recursion we + // don't try to load this power again + // since during the load of a power we also load + // all powers linked to it + $this->state[$guid] = true; + + // make sure to add any language strings found to all language files + // since we can't know where this is used at this point + $tmp_lang_target = $this->config->lang_target; + $this->config->lang_target = 'both'; + + // we set the fix url if needed + $this->fixUrl + = '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id=' + . $this->active[$guid]->id . '" target="_blank"'; + + // set some keys + $this->active[$guid]->target_type = 'P0m3R!'; + $this->active[$guid]->key = $this->active[$guid]->id . '_' . $this->active[$guid]->target_type; + + // reserve some values for the linker + $this->active[$guid]->unchanged_namespace = $this->active[$guid]->namespace; + $this->active[$guid]->unchanged_description = $this->active[$guid]->description; + + // now set the name + $this->active[$guid]->name = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->name) + ); + + // now set the code_name and class name + $this->active[$guid]->code_name = $this->active[$guid]->class_name = ClassfunctionHelper::safe( + $this->active[$guid]->name + ); + + // set official name + $this->active[$guid]->official_name = StringHelper::safe( + $this->active[$guid]->name, 'W' + ); + + // set name space + if (!$this->setNamespace($guid)) + { + $this->state[$guid] = false; + unset($this->active[$guid]); + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + + return false; + } + + // load use ids + $use = []; + $as = []; + + // set extra classes + $this->setLoadSelection($guid); + + // set use classes + $this->setUseSelection($guid, $use, $as); + + // set implement interfaces + $this->setImplements($guid, $use); + + // set extend class + $this->setExtend($guid, $use); + + // set GUI mapper + $guiMapper = [ + 'table' => 'power', + 'id' => (int) $this->active[$guid]->id, + 'type' => 'php' + ]; + + // add the licensing template + $this->setLicensingTemplate($guid, $guiMapper); + + // add the header script + $this->setHeader($guid, $guiMapper); + + // set composer + $this->setComposer($guid); + + // now set the description + $this->active[$guid]->description = (StringHelper::check($this->active[$guid]->description)) ? $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->description), + ) : ''; + + // add the main code if set + $this->setMainClassCode($guid, $guiMapper); + + // load the use classes + $this->setUseAs($guid, $use, $as); + + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + + // set the approved super power values + $this->setSuperPowers($guid); + + return true; + } + } + + // we failed to get the power, + // so we raise an error message + // only if guid is valid + if ($this->isGuidValid($guid)) + { + // now we search for it via the super power paths + if (empty($this->retry[$guid]) && $this->superpower->load($guid, ['remote', 'local'])) + { + // we found it and it was loaded into the database + unset($this->state[$guid]); + unset($this->active[$guid]); + + // we make sure that this retry only happen once! (just in-case...) + $this->retry[$guid] = true; + + // so we try to load it again + return $this->set($guid); + } + + $this->app->enqueueMessage( + Text::sprintf('

Power guid:%s not found!

', $guid), + 'Error' + ); + } + + // let's not try again + $this->state[$guid] = false; + + return false; + } + + /** + * Check if the power is already set + * + * @param string $guid The global unique id of the power + * + * @return bool true if the power is already set + * @since 3.2.0 + */ + private function isPowerSet(string $guid): bool + { + return isset($this->state[$guid]); + } + + /** + * Validate the GUID + * + * @param string $guid The global unique id of the power + * + * @return bool true if the GUID is valid + * @since 3.2.0 + */ + private function isGuidValid(string $guid): bool + { + return GuidHelper::valid($guid); + } + + /** + * Get the power data from the database + * + * @param string $guid The global unique id of the power + * + * @return object|null The power data + * @since 3.2.0 + */ + private function getPowerData(string $guid): ?object + { + $query = $this->db->getQuery(true); + $query->select('a.*'); + $query->from('#__componentbuilder_power AS a'); + $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); + + $this->db->setQuery($query); + $this->db->execute(); + + if ($this->db->getNumRows()) + { + return $this->db->loadObject(); + } + + return null; + } + + /** + * Set the namespace for this power + * + * @param string $guid The global unique id of the power + * + * @return bool + * @since 3.2.0 + */ + private function setNamespace(string $guid): bool + { + // set namespace + $this->active[$guid]->namespace = $this->placeholder->update_( + $this->active[$guid]->namespace + ); + + // validate namespace + if (strpos($this->active[$guid]->namespace, '\\') === false) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('

%s namespace error (%s)

You must at-least have two sections in your namespace, you just have one. This is an unacceptable action, please see psr-4 for more info.

This %s was therefore removed, click here to fix this issue.

', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->namespace, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $this->active[$guid]->type, + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // setup the path array + $path_array = (array) explode('\\', $this->active[$guid]->namespace); + + // make sure all sub folders in src dir is set and remove all characters that will not work in folders naming + $this->active[$guid]->namespace = $this->getCleanNamespace(str_replace('.', '\\', $this->active[$guid]->namespace)); + + // make sure it has two or more + if (ArrayHelper::check($path_array) <= 1) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('

%s namespace error (%s)

You must at-least have two sections in your namespace, you just have one (%s). This is an unacceptable action, please see psr-4 for more info.

This %s was therefore removed, click here to fix this issue.

', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->namespace, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $this->active[$guid]->type, + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // get the file and class name (the last value in array) + $file_name = array_pop($path_array); + + // src array bucket + $src_array = []; + + // do we have src folders + if (strpos($file_name, '.') !== false) + { + // we have src folders in the namespace + $src_array = (array) explode('.', $file_name); + + // get the file and class name (the last value in array) + $this->active[$guid]->file_name = array_pop($src_array); + + // namespace array + $namespace_array = [...$path_array, ...$src_array]; + } + else + { + // set the file name + $this->active[$guid]->file_name = $file_name; + + // namespace array + $namespace_array = $path_array; + } + + // the last value is the same as the class name + if ($this->active[$guid]->file_name !== $this->active[$guid]->class_name) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('

%s naming mismatch error (%s)

The %s name is %s and the ending file name in the namespace is %s. This is bad convention, please see psr-4 for more info.

Click here to fix this issue.

', + ucfirst((string) $this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->type, $this->active[$guid]->class_name, $this->active[$guid]->file_name, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', + $this->fixUrl), + 'Error' + ); + + // we break out here + return false; + } + + // make sure the arrays are namespace safe + $path_array = + array_map( + fn($val) => $this->getCleanNamespace($val), + $path_array + ); + $namespace_array = + array_map( + fn($val) => $this->getCleanNamespace($val), + $namespace_array + ); + + // set the actual class namespace + $this->active[$guid]->_namespace = implode('\\', $namespace_array); + + // set global namespaces for autoloader + $this->namespace[implode('.', $path_array)] = $path_array; + + // get the parent folder (the first value in array) + $prefix_folder = implode('.', $path_array); + + // make sub folders if still found + $sub_folder = ''; + if (ArrayHelper::check($src_array)) + { + // make sure the arrays are namespace safe + $sub_folder = '/' . implode('/', + array_map( + fn($val) => $this->getCleanNamespace($val), + $src_array + ) + ); + } + + // now we set the paths + $this->active[$guid]->path_jcb = $this->config->get('jcb_powers_path', 'libraries/jcb_powers'); + $this->active[$guid]->path_parent = $this->active[$guid]->path_jcb . '/' . $prefix_folder; + $this->active[$guid]->path = $this->active[$guid]->path_parent . '/src' . $sub_folder; + + return true; + } + + /** + * Set Use Classes + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * @param array $as The use as array + * + * @return void + * @since 3.2.0 + */ + private function setUseSelection(string $guid, array &$use, array &$as) + { + // check if we have use selection + $this->active[$guid]->use_selection = (isset($this->active[$guid]->use_selection) + && JsonHelper::check( + $this->active[$guid]->use_selection + )) ? json_decode((string) $this->active[$guid]->use_selection, true) : null; + + if (ArrayHelper::check($this->active[$guid]->use_selection)) + { + $use = array_values(array_map(function ($u) use(&$as) { + // track the AS options + $as[$u['use']] = empty($u['as']) ? 'default' : (string) $u['as']; + // return the guid + return $u['use']; + }, $this->active[$guid]->use_selection)); + } + else + { + $this->active[$guid]->use_selection = null; + } + } + + /** + * Load Extra Classes + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setLoadSelection(string $guid) + { + // check if we have load selection + $this->active[$guid]->load_selection = (isset($this->active[$guid]->load_selection) + && JsonHelper::check( + $this->active[$guid]->load_selection + )) ? json_decode((string) $this->active[$guid]->load_selection, true) : null; + + if (ArrayHelper::check($this->active[$guid]->load_selection)) + { + // load use ids + array_map( + // just load it directly and be done with it + fn($power) => $this->set($power['load']), + $this->active[$guid]->load_selection + ); + } + else + { + $this->active[$guid]->load_selection = null; + } + } + + /** + * Set Composer Linked Use and Access Point + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setComposer(string $guid) + { + // does this have composer powers + $_composer = (isset($this->active[$guid]->composer) + && JsonHelper::check( + $this->active[$guid]->composer + )) ? json_decode((string) $this->active[$guid]->composer, true) : null; + + unset($this->active[$guid]->composer); + + if (ArrayHelper::check($_composer)) + { + // reserve composer values for the linker + $this->active[$guid]->unchanged_composer = $_composer; + + foreach ($_composer as $composer) + { + if (isset($composer['access_point']) && StringHelper::check($composer['access_point']) && + isset($composer['namespace']) && ArrayHelper::check($composer['namespace'])) + { + foreach ($composer['namespace'] as $_namespace) + { + // make sure we have a valid namespace + if (isset($_namespace['use']) && StringHelper::check($_namespace['use']) && + strpos((string) $_namespace['use'], '\\') !== false) + { + // add the namespace to this access point + $as = 'default'; + if (strpos((string) $_namespace['use'], ' as ') !== false) + { + $namespace_as = explode(' as ', (string) $_namespace['use']); + // make sure the AS value is set + if (count($namespace_as) == 2) + { + $as = trim(trim($namespace_as[1], ';')); + } + $namespace = $this->getCleanNamespace($namespace_as[0]); + } + else + { + // trim possible use or ; added to the namespace + $namespace = $this->getCleanNamespace($_namespace['use']); + } + + // check if still valid + if (!StringHelper::check($namespace)) + { + continue; + } + + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace, $as)); + + // add composer namespaces for autoloader + $this->composer[$namespace] = $composer['access_point']; + } + } + } + } + } + else + { + // reserve composer values for the linker + $this->active[$guid]->unchanged_composer = ''; + } + } + + /** + * Set Implements Interface classes + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * + * @return void + * @since 3.2.0 + */ + private function setImplements(string $guid, array &$use) + { + // see if we have implements + $this->active[$guid]->implement_names = []; + + // does this implement + $this->active[$guid]->implements = (isset($this->active[$guid]->implements) + && JsonHelper::check( + $this->active[$guid]->implements + )) ? json_decode((string) $this->active[$guid]->implements, true) : null; + + if ($this->active[$guid]->implements) + { + foreach ($this->active[$guid]->implements as $implement) + { + if ($implement == -1 + && StringHelper::check($this->active[$guid]->implements_custom)) + { + // reserve implements custom for the linker + $this->active[$guid]->unchanged_implements_custom = $this->active[$guid]->implements_custom; + + $this->active[$guid]->implement_names[] = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->implements_custom) + ); + + // just add this once + unset($this->active[$guid]->implements_custom); + } + // does this extend existing + elseif (GuidHelper::valid($implement)) + { + // check if it was set + if ($this->set($implement)) + { + // get the name + $this->active[$guid]->implement_names[] = $this->get($implement, 1)->class_name; + // add to use + $use[] = $implement; + } + } + } + } + } + + /** + * Set Extend Class + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * + * @return void + * @since 3.2.0 + */ + private function setExtend(string $guid, array &$use) + { + // does this extend something + $this->active[$guid]->extends_name = null; + + // we first check for custom extending options + if ($this->active[$guid]->extends == -1 + && StringHelper::check($this->active[$guid]->extends_custom)) + { + // reserve extends custom for the linker + $this->active[$guid]->unchanged_extends_custom = $this->active[$guid]->extends_custom; + + $this->active[$guid]->extends_name = $this->placeholder->update_( + $this->customcode->update($this->active[$guid]->extends_custom) + ); + + // just add once + unset($this->active[$guid]->extends_custom); + } + // does this extend existing + elseif (GuidHelper::valid($this->active[$guid]->extends)) + { + // check if it was set + if ($this->set($this->active[$guid]->extends)) + { + // get the name + $this->active[$guid]->extends_name = $this->get($this->active[$guid]->extends, 1)->class_name; + // add to use + $use[] = $this->active[$guid]->extends; + } + } + } + + /** + * Set Extra Use Classes + * + * @param string $guid The global unique id of the power + * @param array $use The use array + * @param array $as The use as array + * + * @return void + * @since 3.2.0 + */ + private function setUseAs(string $guid, array $use, array $as) + { + // now add all the extra use statements + if (ArrayHelper::check($use)) + { + foreach (array_unique($use) as $u) + { + if ($this->set($u)) + { + // get the namespace + $namespace = $this->get($u, 1)->namespace; + + // check if it has an AS option + if (isset($as[$u]) && StringHelper::check($as[$u])) + { + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace, $as[$u])); + } + else + { + // add to the header of the class + $this->addToHeader($guid, $this->getUseNamespace($namespace)); + } + } + } + } + } + + /** + * Get Clean Namespace without use or ; as part of the name space + * + * @param string $namespace The actual name space + * @param bool $removeNumbers The switch to remove numbers + * + * @return string + * @since 3.2.0 + */ + private function getCleanNamespace(string $namespace): string + { + // trim possible (use) or (;) or (starting or ending \) added to the namespace + return NamespaceHelper::safe(str_replace(['use ', ';'], '', $namespace)); + } + + /** + * Get [use Namespace\Class;] + * + * @param string $namespace The actual name space + * @param string $as The use as name (default is none) + * + * @return string + * @since 3.2.0 + */ + private function getUseNamespace(string $namespace, string $as = 'default'): string + { + // check if it has an AS option + if ($as !== 'default') + { + return 'use ' . $namespace . ' as ' . $as . ';'; + } + return 'use ' . $namespace . ';'; + } + + /** + * Add to class header + * + * @param string $guid The global unique id of the power + * @param string $string The string to add to header + * + * @return void + * @since 3.2.0 + */ + private function addToHeader(string $guid, string $string) + { + // check if it is already added manually + if (isset($this->active[$guid]->head) && + strpos((string) $this->active[$guid]->head, $string) === false) + { + $this->active[$guid]->head .= $string . PHP_EOL; + } + } + + /** + * Set the power licensing template + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setLicensingTemplate(string $guid, array $guiMapper): void + { + if ($this->active[$guid]->add_licensing_template == 2 && + StringHelper::check($this->active[$guid]->licensing_template)) + { + // set GUI mapper field + $guiMapper['field'] = 'licensing_template'; + + // reserve licensing template for the linker + $this->active[$guid]->unchanged_licensing_template = base64_decode( + (string) $this->active[$guid]->licensing_template + ); + + // base64 Decode code + $this->active[$guid]->licensing_template = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + $this->active[$guid]->unchanged_licensing_template + ) + ), + $guiMapper + ); + } + else + { + $this->active[$guid]->add_licensing_template = 1; + $this->active[$guid]->licensing_template = ''; + $this->active[$guid]->unchanged_licensing_template = ''; + } + } + + /** + * Set the power header script + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setHeader(string $guid, array $guiMapper): void + { + if ($this->active[$guid]->add_head == 1) + { + // set GUI mapper field + $guiMapper['field'] = 'head'; + + // reserve header for the linker + $this->active[$guid]->unchanged_head = base64_decode( + (string) $this->active[$guid]->head + ); + + // base64 Decode code + $this->active[$guid]->head = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + $this->active[$guid]->unchanged_head + ) + ), + $guiMapper + ) . PHP_EOL; + } + else + { + $this->active[$guid]->head = ''; + $this->active[$guid]->unchanged_head = ''; + } + } + + /** + * Set the power main class code + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setMainClassCode(string $guid, array $guiMapper): void + { + if (StringHelper::check($this->active[$guid]->main_class_code)) + { + // reserve main class code for the linker + $this->active[$guid]->unchanged_main_class_code = base64_decode( + (string) $this->active[$guid]->main_class_code + ); + + // set GUI mapper field + $guiMapper['field'] = 'main_class_code'; + + // base64 Decode code + $this->active[$guid]->main_class_code = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + $this->active[$guid]->unchanged_main_class_code + ) + ), + $guiMapper + ); + } + else + { + $this->active[$guid]->unchanged_main_class_code = ''; + $this->active[$guid]->main_class_code = ''; + } + } + + /** + * Set the super powers of this power + * + * @param string $guid The global unique id of the power + * + * @return void + * @since 3.2.0 + */ + private function setSuperPowers(string $guid): void + { + // set the approved super power values + if ($this->config->add_super_powers && $this->active[$guid]->approved == 1) + { + $this->active[$guid]->approved_paths = (isset($this->active[$guid]->approved_paths) + && JsonHelper::check( + $this->active[$guid]->approved_paths + )) ? json_decode((string) $this->active[$guid]->approved_paths, true) : null; + + if (ArrayHelper::check($this->active[$guid]->approved_paths)) + { + $global_path = $this->config->local_powers_repository_path; + + // update all paths + $this->active[$guid]->super_power_paths = array_map(function($path) use($global_path, $guid) { + + // remove branch + if (($pos = strpos($path, ':')) !== false) + { + $path = substr($path, 0, $pos); + } + + // set the repo path + $repo = $global_path . '/' . $path; + + // set SuperPowerKey (spk) + $spk = 'Super_'.'_' . str_replace('-', '_', $guid) . '_'.'_Power'; + + // set the global super power + $this->superpowers[$repo][$guid] = [ + 'name' => $this->active[$guid]->code_name, + 'type' => $this->active[$guid]->type, + 'namespace' => $this->active[$guid]->_namespace, + 'code' => 'src/' . $guid . '/code.php', + 'power' => 'src/' . $guid . '/code.power', + 'settings' => 'src/' . $guid . '/settings.json', + 'path' => 'src/' . $guid, + 'spk' => $spk, + 'guid' => $guid + ]; + + return $repo . '/src/' . $guid; + }, array_values($this->active[$guid]->approved_paths)); + + return; + } + } + + // reset all to avoid any misunderstanding down steam + $this->active[$guid]->super_power_paths = null; + $this->active[$guid]->approved_paths = null; + $this->active[$guid]->approved = null; + } \ No newline at end of file diff --git a/src/3730a000-ab64-477d-8b0f-70eaf71b517a/settings.json b/src/3730a000-ab64-477d-8b0f-70eaf71b517a/settings.json new file mode 100644 index 0000000..90fe16a --- /dev/null +++ b/src/3730a000-ab64-477d-8b0f-70eaf71b517a/settings.json @@ -0,0 +1,69 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "3730a000-ab64-477d-8b0f-70eaf71b517a", + "implements": [ + "1133c2d7-ba7e-4c95-8cde-01f084d04682" + ], + "load_selection": null, + "name": "JoomlaPower", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.JoomlaPower", + "type": "final class", + "use_selection": { + "use_selection0": { + "use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a", + "as": "default" + }, + "use_selection1": { + "use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef", + "as": "default" + }, + "use_selection2": { + "use": "4b225c51-d293-48e4-b3f6-5136cf5c3f18", + "as": "default" + }, + "use_selection3": { + "use": "9c513baf-b279-43fd-ae29-a585c8cbc4f0", + "as": "default" + }, + "use_selection4": { + "use": "30c5b4c2-f75f-4d15-869a-f8bfedd87358", + "as": "default" + }, + "use_selection5": { + "use": "ce8cf834-6bac-44fb-941c-861f7e046cc0", + "as": "default" + }, + "use_selection6": { + "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", + "as": "Compiler" + }, + "use_selection7": { + "use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc", + "as": "default" + }, + "use_selection8": { + "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", + "as": "default" + }, + "use_selection9": { + "use": "313b43c4-98c3-4f62-9177-2d73ec8eba31", + "as": "default" + }, + "use_selection10": { + "use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3", + "as": "default" + }, + "use_selection11": { + "use": "39a75870-a7f7-45fd-937d-5ba97b85b8ad", + "as": "SuperPower" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaPower", + "description": "Power", + "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\\CMS\\Factory;\r\nuse Joomla\\CMS\\Application\\CMSApplication;\r\nuse Joomla\\CMS\\Language\\Text;", + "composer": "" +} \ No newline at end of file diff --git a/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/README.md b/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/README.md index 1b6a68d..5344ce2 100644 --- a/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/README.md +++ b/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/README.md @@ -6,13 +6,14 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# final class Insert (Details) +# class Insert (Details) > namespace: **VDM\Joomla\Componentbuilder\Power\Database** ```uml @startuml -class Insert << (F,LightGreen) >> #RoyalBlue { +class Insert #Gold { # Model $model # Database $database + # string $table + __construct(Model $model, Database $database) + value(mixed $value, string $field, ...) : bool + row(array $item) : bool diff --git a/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.php b/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.php index e01e5e0..b901321 100644 --- a/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.php +++ b/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.php @@ -12,8 +12,9 @@ namespace VDM\Joomla\Componentbuilder\Power\Database; -use VDM\Joomla\Componentbuilder\Power\Model\Upsert as Model; +use VDM\Joomla\Interfaces\ModelInterface as Model; use VDM\Joomla\Database\Insert as Database; +use VDM\Joomla\Componentbuilder\Interfaces\Database\InsertInterface; /** @@ -21,7 +22,7 @@ use VDM\Joomla\Database\Insert as Database; * * @since 3.2.0 */ -final class Insert +class Insert implements InsertInterface { /** * Model @@ -39,6 +40,14 @@ final class Insert */ protected Database $database; + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'power'; + /** * Constructor * @@ -88,10 +97,10 @@ final class Insert public function row(array $item): bool { // check if object could be modelled - if (($item = $this->model->row($item, 'power')) !== null) + if (($item = $this->model->row($item, $this->table)) !== null) { // Insert the column of this table - return $this->database->row($item, 'power'); + return $this->database->row($item, $this->table); } return false; } @@ -108,10 +117,10 @@ final class Insert public function rows(?array $items): bool { // check if object could be modelled - if (($items = $this->model->rows($items, 'power')) !== null) + if (($items = $this->model->rows($items, $this->table)) !== null) { // Insert the column of this table - return $this->database->rows($items, 'power'); + return $this->database->rows($items, $this->table); } return false; } @@ -128,10 +137,10 @@ final class Insert public function item(object $item): bool { // check if object could be modelled - if (($item = $this->model->item($item, 'power')) !== null) + if (($item = $this->model->item($item, $this->table)) !== null) { // Insert the column of this table - return $this->database->item($item, 'power'); + return $this->database->item($item, $this->table); } return false; } @@ -148,13 +157,12 @@ final class Insert public function items(?array $items): bool { // check if object could be modelled - if (($items = $this->model->items($items, 'power')) !== null) + if (($items = $this->model->items($items, $this->table)) !== null) { // Update the column of this table using guid as the primary key. - return $this->database->items($items, 'power'); + return $this->database->items($items, $this->table); } return false; - } - + } } diff --git a/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.power b/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.power index 65ac875..c7be64c 100644 --- a/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.power +++ b/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/code.power @@ -14,6 +14,14 @@ */ protected Database $database; + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'power'; + /** * Constructor * @@ -63,10 +71,10 @@ public function row(array $item): bool { // check if object could be modelled - if (($item = $this->model->row($item, 'power')) !== null) + if (($item = $this->model->row($item, $this->table)) !== null) { // Insert the column of this table - return $this->database->row($item, 'power'); + return $this->database->row($item, $this->table); } return false; } @@ -83,10 +91,10 @@ public function rows(?array $items): bool { // check if object could be modelled - if (($items = $this->model->rows($items, 'power')) !== null) + if (($items = $this->model->rows($items, $this->table)) !== null) { // Insert the column of this table - return $this->database->rows($items, 'power'); + return $this->database->rows($items, $this->table); } return false; } @@ -103,10 +111,10 @@ public function item(object $item): bool { // check if object could be modelled - if (($item = $this->model->item($item, 'power')) !== null) + if (($item = $this->model->item($item, $this->table)) !== null) { // Insert the column of this table - return $this->database->item($item, 'power'); + return $this->database->item($item, $this->table); } return false; } @@ -123,10 +131,10 @@ public function items(?array $items): bool { // check if object could be modelled - if (($items = $this->model->items($items, 'power')) !== null) + if (($items = $this->model->items($items, $this->table)) !== null) { // Update the column of this table using guid as the primary key. - return $this->database->items($items, 'power'); + return $this->database->items($items, $this->table); } return false; - } + } \ No newline at end of file diff --git a/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/settings.json b/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/settings.json index 1778213..7d300ff 100644 --- a/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/settings.json +++ b/src/380bb7a3-cdcc-4336-a699-5070cbf521a5/settings.json @@ -3,15 +3,17 @@ "add_licensing_template": "2", "extends": "0", "guid": "380bb7a3-cdcc-4336-a699-5070cbf521a5", - "implements": null, + "implements": [ + "95c02df3-fe0a-405b-b506-b7a5b8605b66" + ], "load_selection": null, "name": "Insert", "power_version": "1.0.0", "system_name": "JCB.Power.Database.Insert", - "type": "final class", + "type": "class", "use_selection": { "use_selection0": { - "use": "7c1fb50f-8fb1-4627-8705-6fedf7182ca5", + "use": "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff", "as": "Model" }, "use_selection1": { diff --git a/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/README.md b/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/README.md new file mode 100644 index 0000000..a15ae8d --- /dev/null +++ b/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/README.md @@ -0,0 +1,31 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Super (Details) +> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower** +> extends: **Super** +```uml +@startuml +class Super << (F,LightGreen) >> #RoyalBlue { + # string $table +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/code.php b/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/code.php new file mode 100644 index 0000000..c4574e9 --- /dev/null +++ b/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/code.php @@ -0,0 +1,34 @@ + + * @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\JoomlaPower; + + +use VDM\Joomla\Componentbuilder\Interfaces\SuperInterface; +use VDM\Joomla\Componentbuilder\Power\Super; + + +/** + * Super Joomla Power of JCB + * + * @since 3.2.0 + */ +final class Super extends Super implements SuperInterface +{ + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'joomla_power'; +} + diff --git a/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/code.power b/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/code.power new file mode 100644 index 0000000..1d2fc75 --- /dev/null +++ b/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/code.power @@ -0,0 +1,7 @@ + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'joomla_power'; \ No newline at end of file diff --git a/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/settings.json b/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/settings.json new file mode 100644 index 0000000..0a2b316 --- /dev/null +++ b/src/39a75870-a7f7-45fd-937d-5ba97b85b8ad/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "3ab0eba9-f37b-4b37-aec1-2e78067f2aff", + "guid": "39a75870-a7f7-45fd-937d-5ba97b85b8ad", + "implements": [ + "51de80f2-2868-4c2c-8198-ef79349e9bd7" + ], + "load_selection": null, + "name": "Super", + "power_version": "1.0.0", + "system_name": "JCB.JoomlaPower.Super", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Super", + "description": "Super Joomla Power of JCB\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/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/README.md b/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/README.md index 878071f..cd07215 100644 --- a/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/README.md +++ b/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/README.md @@ -6,14 +6,15 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# final class Super (Details) +# class Super (Details) > namespace: **VDM\Joomla\Componentbuilder\Power** ```uml @startuml -class Super << (F,LightGreen) >> #RoyalBlue { +class Super #Gold { # Grep $grep # Insert $insert # Update $update + # string $table + __construct(Grep $grep, Insert $insert, ...) + init() : bool + reset(array $powers) : bool diff --git a/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.php b/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.php index 30d9fa3..400d9bf 100644 --- a/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.php +++ b/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.php @@ -12,9 +12,9 @@ namespace VDM\Joomla\Componentbuilder\Power; -use VDM\Joomla\Componentbuilder\Power\Grep; -use VDM\Joomla\Componentbuilder\Power\Database\Insert; -use VDM\Joomla\Componentbuilder\Power\Database\Update; +use VDM\Joomla\Componentbuilder\Interfaces\GrepInterface as Grep; +use VDM\Joomla\Componentbuilder\Interfaces\Database\InsertInterface as Insert; +use VDM\Joomla\Componentbuilder\Interfaces\Database\UpdateInterface as Update; use VDM\Joomla\Utilities\GuidHelper; @@ -23,7 +23,7 @@ use VDM\Joomla\Utilities\GuidHelper; * * @since 3.2.0 */ -final class Super +class Super { /** * The Power Search Tool @@ -49,6 +49,14 @@ final class Super **/ protected Update $update; + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'power'; + /** * Constructor. * @@ -174,7 +182,7 @@ final class Super */ private function action(string $guid): string { - if (($id = GuidHelper::item($guid, 'power')) !== null && $id > 0) + if (($id = GuidHelper::item($guid, $this->table)) !== null && $id > 0) { return 'update'; } diff --git a/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.power b/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.power index 133ae8f..0f31917 100644 --- a/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.power +++ b/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/code.power @@ -22,6 +22,14 @@ **/ protected Update $update; + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'power'; + /** * Constructor. * @@ -147,7 +155,7 @@ */ private function action(string $guid): string { - if (($id = GuidHelper::item($guid, 'power')) !== null && $id > 0) + if (($id = GuidHelper::item($guid, $this->table)) !== null && $id > 0) { return 'update'; } diff --git a/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/settings.json b/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/settings.json index 8d2199a..c14a93f 100644 --- a/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/settings.json +++ b/src/3ab0eba9-f37b-4b37-aec1-2e78067f2aff/settings.json @@ -8,19 +8,19 @@ "name": "Super", "power_version": "1.0.0", "system_name": "JCB.Power.Super", - "type": "final class", + "type": "class", "use_selection": { "use_selection0": { - "use": "6784dd52-0909-451a-a872-9a942a023c68", - "as": "default" + "use": "c182506a-ab84-439c-b962-1e606b58d545", + "as": "Grep" }, "use_selection1": { - "use": "380bb7a3-cdcc-4336-a699-5070cbf521a5", - "as": "default" + "use": "95c02df3-fe0a-405b-b506-b7a5b8605b66", + "as": "Insert" }, "use_selection2": { - "use": "e543c123-b1d9-4a0b-83b2-a9d371da5ff3", - "as": "default" + "use": "69c29be3-ab25-4f56-944e-7ada6307b10c", + "as": "Update" }, "use_selection3": { "use": "9c513baf-b279-43fd-ae29-a585c8cbc4f0", diff --git a/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/README.md b/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/README.md new file mode 100644 index 0000000..c078a65 --- /dev/null +++ b/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/README.md @@ -0,0 +1,58 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface SuperInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces** +```uml +@startuml +interface SuperInterface #Lavender { + + init() : bool + + reset(array $powers) : bool + + load(string $guid, array $order = ['remote', 'local'], ...) : bool +} + +note right of SuperInterface::init + Init all power not found in database + + since: 3.2.0 + return: bool +end note + +note right of SuperInterface::reset + Reset the powers + + since: 3.2.0 + return: bool +end note + +note right of SuperInterface::load + Load a superpower + + since: 3.2.0 + return: bool + + arguments: + string $guid + array $order = ['remote', 'local'] + ?string $action = null +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/code.php b/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/code.php new file mode 100644 index 0000000..21b6a39 --- /dev/null +++ b/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/code.php @@ -0,0 +1,52 @@ + + * @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; + + +/** + * Superpower of JCB + * + * @since 3.2.0 + */ +interface SuperInterface +{ + /** + * Init all power not found in database + * + * @return bool + * @since 3.2.0 + */ + public function init(): bool; + + /** + * Reset the powers + * + * @param array $powers The global unique ids of the powers + * + * @return bool + * @since 3.2.0 + */ + public function reset(array $powers): bool; + + /** + * Load a superpower + * + * @param string $guid The global unique id of the power + * @param array $order The search order + * @param string|null $action The action to load power + * + * @return bool + * @since 3.2.0 + */ + public function load(string $guid, array $order = ['remote', 'local'], ?string $action = null): bool; +} + diff --git a/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/code.power b/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/code.power new file mode 100644 index 0000000..75caddf --- /dev/null +++ b/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/code.power @@ -0,0 +1,29 @@ + /** + * Init all power not found in database + * + * @return bool + * @since 3.2.0 + */ + public function init(): bool; + + /** + * Reset the powers + * + * @param array $powers The global unique ids of the powers + * + * @return bool + * @since 3.2.0 + */ + public function reset(array $powers): bool; + + /** + * Load a superpower + * + * @param string $guid The global unique id of the power + * @param array $order The search order + * @param string|null $action The action to load power + * + * @return bool + * @since 3.2.0 + */ + public function load(string $guid, array $order = ['remote', 'local'], ?string $action = null): bool; \ No newline at end of file diff --git a/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/settings.json b/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/settings.json new file mode 100644 index 0000000..3be0ccc --- /dev/null +++ b/src/51de80f2-2868-4c2c-8198-ef79349e9bd7/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "51de80f2-2868-4c2c-8198-ef79349e9bd7", + "implements": null, + "load_selection": null, + "name": "SuperInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Super", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.SuperInterface", + "description": "Superpower of JCB\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/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/README.md b/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/README.md new file mode 100644 index 0000000..02568fa --- /dev/null +++ b/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/README.md @@ -0,0 +1,101 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# class JoomlaPower (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\Service** +```uml +@startuml +class JoomlaPower #Gold { + + register(Container $container) : void + + getPowers(Container $container) : Powers + + getSuperpower(Container $container) : Superpower + + getGrep(Container $container) : Grep + + getExtractor(Container $container) : Extractor + + getInjector(Container $container) : Injector + + getModelUpsert(Container $container) : Upsert + + getInsert(Container $container) : Insert + + getUpdate(Container $container) : Update +} + +note right of JoomlaPower::register + Registers the service provider with a DI container. + + since: 3.2.0 + return: void +end note + +note left of JoomlaPower::getPowers + Get the Powers + + since: 3.2.0 + return: Powers +end note + +note right of JoomlaPower::getSuperpower + Get the Superpower + + since: 3.2.0 + return: Superpower +end note + +note left of JoomlaPower::getGrep + Get the Grep + + since: 3.2.0 + return: Grep +end note + +note right of JoomlaPower::getExtractor + Get the Compiler Power Extractor + + since: 3.2.0 + return: Extractor +end note + +note left of JoomlaPower::getInjector + Get the Compiler Power Injector + + since: 3.2.0 + return: Injector +end note + +note right of JoomlaPower::getModelUpsert + Get the Power Model Upsert + + since: 3.2.0 + return: Upsert +end note + +note left of JoomlaPower::getInsert + Get the Power Insert + + since: 3.2.0 + return: Insert +end note + +note right of JoomlaPower::getUpdate + Get the Power Update + + since: 3.2.0 + return: Update +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/code.php b/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/code.php new file mode 100644 index 0000000..46e6859 --- /dev/null +++ b/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/code.php @@ -0,0 +1,198 @@ + + * @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\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaPower as Powers; +use VDM\Joomla\Componentbuilder\JoomlaPower\Grep; +use VDM\Joomla\Componentbuilder\JoomlaPower\Super as Superpower; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaPower\Extractor; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaPower\Injector; +use VDM\Joomla\Componentbuilder\JoomlaPower\Model\Upsert; +use VDM\Joomla\Componentbuilder\JoomlaPower\Database\Insert; +use VDM\Joomla\Componentbuilder\JoomlaPower\Database\Update; + + +/** + * Compiler Joomla Power Service Provider + * + * @since 3.2.0 + */ +class JoomlaPower implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Powers::class, 'Joomla.Power') + ->share('Joomla.Power', [$this, 'getPowers'], true); + + $container->alias(Superpower::class, 'Joomla.Superpower') + ->share('Joomla.Superpower', [$this, 'getSuperpower'], true); + + $container->alias(Grep::class, 'Joomla.Power.Grep') + ->share('Joomla.Power.Grep', [$this, 'getGrep'], true); + + $container->alias(Extractor::class, 'Joomla.Power.Extractor') + ->share('Power.Extractor', [$this, 'getExtractor'], true); + + $container->alias(Injector::class, 'Joomla.Power.Injector') + ->share('Power.Injector', [$this, 'getInjector'], true); + + $container->alias(Upsert::class, 'Joomla.Power.Model.Upsert') + ->share('Power.Model.Upsert', [$this, 'getModelUpsert'], true); + + $container->alias(Insert::class, 'Joomla.Power.Insert') + ->share('Power.Insert', [$this, 'getInsert'], true); + + $container->alias(Update::class, 'Joomla.Power.Update') + ->share('Power.Update', [$this, 'getUpdate'], true); + } + + /** + * Get the Powers + * + * @param Container $container The DI container. + * + * @return Powers + * @since 3.2.0 + */ + public function getPowers(Container $container): Powers + { + return new Powers( + $container->get('Config') + ); + } + + /** + * Get the Superpower + * + * @param Container $container The DI container. + * + * @return Superpower + * @since 3.2.0 + */ + public function getSuperpower(Container $container): Superpower + { + return new Superpower( + $container->get('Joomla.Power.Grep'), + $container->get('Joomla.Power.Insert'), + $container->get('Joomla.Power.Update') + ); + } + + /** + * Get the Grep + * + * @param Container $container The DI container. + * + * @return Grep + * @since 3.2.0 + */ + public function getGrep(Container $container): Grep + { + return new Grep( + $container->get('Config')->local_powers_repository_path, + $container->get('Config')->approved_paths, + $container->get('Gitea.Repository.Contents') + ); + } + + /** + * Get the Compiler Power Extractor + * + * @param Container $container The DI container. + * + * @return Extractor + * @since 3.2.0 + */ + public function getExtractor(Container $container): Extractor + { + return new Extractor( + $container->get('Config')->joomla_version + ); + } + + /** + * Get the Compiler Power Injector + * + * @param Container $container The DI container. + * + * @return Injector + * @since 3.2.0 + */ + public function getInjector(Container $container): Injector + { + return new Injector( + $container->get('Joomla.Power'), + $container->get('Joomla.Power.Extractor'), + $container->get('Power.Parser'), + $container->get('Placeholder') + ); + } + + /** + * Get the Power Model Upsert + * + * @param Container $container The DI container. + * + * @return Upsert + * @since 3.2.0 + */ + public function getModelUpsert(Container $container): Upsert + { + return new Upsert( + $container->get('Table') + ); + } + + /** + * Get the Power Insert + * + * @param Container $container The DI container. + * + * @return Insert + * @since 3.2.0 + */ + public function getInsert(Container $container): Insert + { + return new Insert( + $container->get('Joomla.Power.Model.Upsert'), + $container->get('Insert') + ); + } + + /** + * Get the Power Update + * + * @param Container $container The DI container. + * + * @return Update + * @since 3.2.0 + */ + public function getUpdate(Container $container): Update + { + return new Update( + $container->get('Joomla.Power.Model.Upsert'), + $container->get('Update') + ); + } +} + diff --git a/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/code.power b/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/code.power new file mode 100644 index 0000000..9979903 --- /dev/null +++ b/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/code.power @@ -0,0 +1,163 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Powers::class, 'Joomla.Power') + ->share('Joomla.Power', [$this, 'getPowers'], true); + + $container->alias(Superpower::class, 'Joomla.Superpower') + ->share('Joomla.Superpower', [$this, 'getSuperpower'], true); + + $container->alias(Grep::class, 'Joomla.Power.Grep') + ->share('Joomla.Power.Grep', [$this, 'getGrep'], true); + + $container->alias(Extractor::class, 'Joomla.Power.Extractor') + ->share('Power.Extractor', [$this, 'getExtractor'], true); + + $container->alias(Injector::class, 'Joomla.Power.Injector') + ->share('Power.Injector', [$this, 'getInjector'], true); + + $container->alias(Upsert::class, 'Joomla.Power.Model.Upsert') + ->share('Power.Model.Upsert', [$this, 'getModelUpsert'], true); + + $container->alias(Insert::class, 'Joomla.Power.Insert') + ->share('Power.Insert', [$this, 'getInsert'], true); + + $container->alias(Update::class, 'Joomla.Power.Update') + ->share('Power.Update', [$this, 'getUpdate'], true); + } + + /** + * Get the Powers + * + * @param Container $container The DI container. + * + * @return Powers + * @since 3.2.0 + */ + public function getPowers(Container $container): Powers + { + return new Powers( + $container->get('Config') + ); + } + + /** + * Get the Superpower + * + * @param Container $container The DI container. + * + * @return Superpower + * @since 3.2.0 + */ + public function getSuperpower(Container $container): Superpower + { + return new Superpower( + $container->get('Joomla.Power.Grep'), + $container->get('Joomla.Power.Insert'), + $container->get('Joomla.Power.Update') + ); + } + + /** + * Get the Grep + * + * @param Container $container The DI container. + * + * @return Grep + * @since 3.2.0 + */ + public function getGrep(Container $container): Grep + { + return new Grep( + $container->get('Config')->local_powers_repository_path, + $container->get('Config')->approved_paths, + $container->get('Gitea.Repository.Contents') + ); + } + + /** + * Get the Compiler Power Extractor + * + * @param Container $container The DI container. + * + * @return Extractor + * @since 3.2.0 + */ + public function getExtractor(Container $container): Extractor + { + return new Extractor( + $container->get('Config')->joomla_version + ); + } + + /** + * Get the Compiler Power Injector + * + * @param Container $container The DI container. + * + * @return Injector + * @since 3.2.0 + */ + public function getInjector(Container $container): Injector + { + return new Injector( + $container->get('Joomla.Power'), + $container->get('Joomla.Power.Extractor'), + $container->get('Power.Parser'), + $container->get('Placeholder') + ); + } + + /** + * Get the Power Model Upsert + * + * @param Container $container The DI container. + * + * @return Upsert + * @since 3.2.0 + */ + public function getModelUpsert(Container $container): Upsert + { + return new Upsert( + $container->get('Table') + ); + } + + /** + * Get the Power Insert + * + * @param Container $container The DI container. + * + * @return Insert + * @since 3.2.0 + */ + public function getInsert(Container $container): Insert + { + return new Insert( + $container->get('Joomla.Power.Model.Upsert'), + $container->get('Insert') + ); + } + + /** + * Get the Power Update + * + * @param Container $container The DI container. + * + * @return Update + * @since 3.2.0 + */ + public function getUpdate(Container $container): Update + { + return new Update( + $container->get('Joomla.Power.Model.Upsert'), + $container->get('Update') + ); + } \ No newline at end of file diff --git a/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/settings.json b/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/settings.json new file mode 100644 index 0000000..f99ec47 --- /dev/null +++ b/src/5716c79f-a1c9-4059-9d00-8cccb9f9e061/settings.json @@ -0,0 +1,54 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "5716c79f-a1c9-4059-9d00-8cccb9f9e061", + "implements": [ + "-1" + ], + "load_selection": null, + "name": "JoomlaPower", + "power_version": "1.0.0", + "system_name": "JCB.Compiler.Service.JoomlaPower", + "type": "class", + "use_selection": { + "use_selection0": { + "use": "3730a000-ab64-477d-8b0f-70eaf71b517a", + "as": "Powers" + }, + "use_selection1": { + "use": "355bf21a-f859-4528-9110-bcd2c6d05ea7", + "as": "default" + }, + "use_selection2": { + "use": "39a75870-a7f7-45fd-937d-5ba97b85b8ad", + "as": "Superpower" + }, + "use_selection3": { + "use": "82505f3f-297f-4d75-a581-929ab3e93689", + "as": "default" + }, + "use_selection4": { + "use": "a6052fe9-0d2b-4b36-b3e7-03b47c483542", + "as": "default" + }, + "use_selection5": { + "use": "9206082e-a3f7-472e-98b2-de90d06cbdcd", + "as": "default" + }, + "use_selection6": { + "use": "9d53d45e-9b4d-45ec-827b-4916b91c907e", + "as": "default" + }, + "use_selection7": { + "use": "679473f6-3ea2-49d5-8273-1b29c8f0ad2b", + "as": "default" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Service.JoomlaPower", + "description": "Compiler Joomla Power Service Provider\r\n\r\n@since 3.2.0", + "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/6784dd52-0909-451a-a872-9a942a023c68/README.md b/src/6784dd52-0909-451a-a872-9a942a023c68/README.md index add5e24..e28bfee 100644 --- a/src/6784dd52-0909-451a-a872-9a942a023c68/README.md +++ b/src/6784dd52-0909-451a-a872-9a942a023c68/README.md @@ -6,11 +6,11 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# final class Grep (Details) +# class Grep (Details) > namespace: **VDM\Joomla\Componentbuilder\Power** ```uml @startuml -class Grep << (F,LightGreen) >> #RoyalBlue { +class Grep #Gold { + ?string $path + ?array $paths # Contents $contents diff --git a/src/6784dd52-0909-451a-a872-9a942a023c68/code.php b/src/6784dd52-0909-451a-a872-9a942a023c68/code.php index 709036f..20e2e9d 100644 --- a/src/6784dd52-0909-451a-a872-9a942a023c68/code.php +++ b/src/6784dd52-0909-451a-a872-9a942a023c68/code.php @@ -19,6 +19,7 @@ use Joomla\CMS\Language\Text; use VDM\Joomla\Gitea\Repository\Contents; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Componentbuilder\Interfaces\GrepInterface; /** @@ -31,7 +32,7 @@ use VDM\Joomla\Utilities\JsonHelper; * * @since 3.2.0 */ -final class Grep +class Grep implements GrepInterface { /** * The local path diff --git a/src/6784dd52-0909-451a-a872-9a942a023c68/settings.json b/src/6784dd52-0909-451a-a872-9a942a023c68/settings.json index 8497b6b..019c0b4 100644 --- a/src/6784dd52-0909-451a-a872-9a942a023c68/settings.json +++ b/src/6784dd52-0909-451a-a872-9a942a023c68/settings.json @@ -3,12 +3,14 @@ "add_licensing_template": "2", "extends": "0", "guid": "6784dd52-0909-451a-a872-9a942a023c68", - "implements": null, + "implements": [ + "c182506a-ab84-439c-b962-1e606b58d545" + ], "load_selection": null, "name": "Grep", "power_version": "1.0.0", "system_name": "JCB.Power.Grep", - "type": "final class", + "type": "class", "use_selection": { "use_selection0": { "use": "8d1baef6-fcad-49a9-848f-428009cdb989", diff --git a/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/README.md b/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/README.md new file mode 100644 index 0000000..2bd3796 --- /dev/null +++ b/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/README.md @@ -0,0 +1,31 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Update (Details) +> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower\Database** +> extends: **Update** +```uml +@startuml +class Update << (F,LightGreen) >> #RoyalBlue { + # string $table +} + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/code.php b/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/code.php new file mode 100644 index 0000000..1387a1c --- /dev/null +++ b/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/code.php @@ -0,0 +1,34 @@ + + * @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\JoomlaPower\Database; + + +use VDM\Joomla\Componentbuilder\Interfaces\Database\UpdateInterface; +use VDM\Joomla\Componentbuilder\Power\Database\Update; + + +/** + * Joomla Power Database Update + * + * @since 3.2.0 + */ +final class Update extends Update implements UpdateInterface +{ + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'joomla_power'; +} + diff --git a/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/code.power b/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/code.power new file mode 100644 index 0000000..1d2fc75 --- /dev/null +++ b/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/code.power @@ -0,0 +1,7 @@ + /** + * Table Name + * + * @var string + * @since 3.2.1 + */ + protected string $table = 'joomla_power'; \ No newline at end of file diff --git a/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/settings.json b/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/settings.json new file mode 100644 index 0000000..8754296 --- /dev/null +++ b/src/679473f6-3ea2-49d5-8273-1b29c8f0ad2b/settings.json @@ -0,0 +1,20 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "e543c123-b1d9-4a0b-83b2-a9d371da5ff3", + "guid": "679473f6-3ea2-49d5-8273-1b29c8f0ad2b", + "implements": [ + "69c29be3-ab25-4f56-944e-7ada6307b10c" + ], + "load_selection": null, + "name": "Update", + "power_version": "1.0.0", + "system_name": "JCB.JoomlaPower.Database.Update", + "type": "final class", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Database.Update", + "description": "Joomla Power Database Update\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/src/69c29be3-ab25-4f56-944e-7ada6307b10c/README.md b/src/69c29be3-ab25-4f56-944e-7ada6307b10c/README.md new file mode 100644 index 0000000..4261ceb --- /dev/null +++ b/src/69c29be3-ab25-4f56-944e-7ada6307b10c/README.md @@ -0,0 +1,80 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# interface UpdateInterface (Details) +> namespace: **VDM\Joomla\Componentbuilder\Interfaces\Database** +```uml +@startuml +interface UpdateInterface #Lavender { + + 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 UpdateInterface::value + Update a value to a given table +Example: $this->value(Value, 'value_key', 'GUID'); + + since: 3.2.0 + return: bool + + arguments: + mixed $value + string $field + string $keyValue + string $key = 'guid' +end note + +note right of UpdateInterface::row + Update single row with multiple values to a given table +Example: $this->item(Array); + + since: 3.2.0 + return: bool +end note + +note right of UpdateInterface::rows + Update multiple rows to a given table +Example: $this->items(Array); + + since: 3.2.0 + return: bool +end note + +note right of UpdateInterface::item + Update single item with multiple values to a given table +Example: $this->item(Object); + + since: 3.2.0 + return: bool +end note + +note right of UpdateInterface::items + Update multiple items to a given table +Example: $this->items(Array); + + since: 3.2.0 + return: bool +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/69c29be3-ab25-4f56-944e-7ada6307b10c/code.php b/src/69c29be3-ab25-4f56-944e-7ada6307b10c/code.php new file mode 100644 index 0000000..45658ee --- /dev/null +++ b/src/69c29be3-ab25-4f56-944e-7ada6307b10c/code.php @@ -0,0 +1,80 @@ + + * @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; + + +/** + * Database Update + * + * @since 3.2.1 + */ +interface UpdateInterface +{ + /** + * 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 3.2.0 + */ + public function value($value, string $field, string $keyValue, string $key = 'guid'): bool; + + /** + * Update single row with multiple values to a given table + * Example: $this->item(Array); + * + * @param array $item The item to save + * + * @return bool + * @since 3.2.0 + */ + public function row(array $item): bool; + + /** + * 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 3.2.0 + */ + public function rows(?array $items): bool; + + /** + * Update single item with multiple values to a given table + * Example: $this->item(Object); + * + * @param object $item The item to save + * + * @return bool + * @since 3.2.0 + */ + public function item(object $item): bool; + + /** + * 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 3.2.0 + */ + public function items(?array $items): bool; +} + diff --git a/src/69c29be3-ab25-4f56-944e-7ada6307b10c/code.power b/src/69c29be3-ab25-4f56-944e-7ada6307b10c/code.power new file mode 100644 index 0000000..20feff1 --- /dev/null +++ b/src/69c29be3-ab25-4f56-944e-7ada6307b10c/code.power @@ -0,0 +1,57 @@ + /** + * 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 3.2.0 + */ + public function value($value, string $field, string $keyValue, string $key = 'guid'): bool; + + /** + * Update single row with multiple values to a given table + * Example: $this->item(Array); + * + * @param array $item The item to save + * + * @return bool + * @since 3.2.0 + */ + public function row(array $item): bool; + + /** + * 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 3.2.0 + */ + public function rows(?array $items): bool; + + /** + * Update single item with multiple values to a given table + * Example: $this->item(Object); + * + * @param object $item The item to save + * + * @return bool + * @since 3.2.0 + */ + public function item(object $item): bool; + + /** + * 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 3.2.0 + */ + public function items(?array $items): bool; \ No newline at end of file diff --git a/src/69c29be3-ab25-4f56-944e-7ada6307b10c/settings.json b/src/69c29be3-ab25-4f56-944e-7ada6307b10c/settings.json new file mode 100644 index 0000000..4e457d8 --- /dev/null +++ b/src/69c29be3-ab25-4f56-944e-7ada6307b10c/settings.json @@ -0,0 +1,18 @@ +{ + "add_head": "0", + "add_licensing_template": "2", + "extends": "0", + "guid": "69c29be3-ab25-4f56-944e-7ada6307b10c", + "implements": null, + "load_selection": null, + "name": "UpdateInterface", + "power_version": "1.0.0", + "system_name": "JCB.Interfaces.Database.UpdateInterface", + "type": "interface", + "use_selection": null, + "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.Database.UpdateInterface", + "description": "Database Update\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": "" +} \ No newline at end of file diff --git a/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/README.md b/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/README.md new file mode 100644 index 0000000..b2b495a --- /dev/null +++ b/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/README.md @@ -0,0 +1,54 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# abstract class Factory (Details) +> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower** +```uml +@startuml +abstract Factory #Orange { + # static $container + + {static} _(string $key) : Mixed + + {static} getContainer() : Container + # {static} createContainer() : Container +} + +note right of Factory::_ + Get any class from the package container + + since: 3.2.0 + return: Mixed +end note + +note right of Factory::getContainer + Get the global package container + + since: 3.2.0 + return: Container +end note + +note right of Factory::createContainer + Create a container object + + since: 3.2.0 + return: Container +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/code.php b/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/code.php new file mode 100644 index 0000000..8afc324 --- /dev/null +++ b/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/code.php @@ -0,0 +1,86 @@ + + * @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\JoomlaPower; + + +use Joomla\DI\Container; +use VDM\Joomla\Componentbuilder\Compiler\Service\JoomlaPower as Power; +use VDM\Joomla\Componentbuilder\Service\Database; +use VDM\Joomla\Componentbuilder\JoomlaPower\Service\Database as PowerDatabase; +use VDM\Joomla\Componentbuilder\Service\Gitea; +use VDM\Joomla\Componentbuilder\Power\Service\Gitea as GiteaPower; +use VDM\Joomla\Gitea\Service\Utilities as GiteaUtilities; +use VDM\Joomla\Interfaces\FactoryInterface; + + +/** + * Joomla Power Factory + * + * @since 3.2.0 + */ +abstract class Factory implements FactoryInterface +{ + /** + * Global Package Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Get any class from the package container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get the global package container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Power()) + ->registerServiceProvider(new Database()) + ->registerServiceProvider(new PowerDatabase()) + ->registerServiceProvider(new Gitea()) + ->registerServiceProvider(new GiteaPower()) + ->registerServiceProvider(new GiteaUtilities()); + } +} + diff --git a/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/code.power b/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/code.power new file mode 100644 index 0000000..bf8a909 --- /dev/null +++ b/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/code.power @@ -0,0 +1,53 @@ + /** + * Global Package Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Get any class from the package container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get the global package container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + return (new Container()) + ->registerServiceProvider(new Power()) + ->registerServiceProvider(new Database()) + ->registerServiceProvider(new PowerDatabase()) + ->registerServiceProvider(new Gitea()) + ->registerServiceProvider(new GiteaPower()) + ->registerServiceProvider(new GiteaUtilities()); + } \ No newline at end of file diff --git a/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/settings.json b/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/settings.json new file mode 100644 index 0000000..6fbdc9f --- /dev/null +++ b/src/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400/settings.json @@ -0,0 +1,45 @@ +{ + "add_head": "1", + "add_licensing_template": "2", + "extends": "0", + "guid": "6ee3dc9e-1949-4da5-a74f-d9eb7f14e400", + "implements": [ + "caf33c5d-858c-4f9a-894f-ab302ec5445a" + ], + "load_selection": null, + "name": "Factory", + "power_version": "1.0.0", + "system_name": "JCB.JoomlaPower.Factory", + "type": "abstract class", + "use_selection": { + "use_selection0": { + "use": "5716c79f-a1c9-4059-9d00-8cccb9f9e061", + "as": "Power" + }, + "use_selection1": { + "use": "4815e1c7-a433-443d-a112-d1e03d7df84b", + "as": "default" + }, + "use_selection2": { + "use": "a2992a91-eec2-4957-811b-8cde22aa1438", + "as": "PowerDatabase" + }, + "use_selection3": { + "use": "71acf8d6-32b8-4173-8277-eb9cda29fd64", + "as": "default" + }, + "use_selection4": { + "use": "510dc0f6-da3f-4a78-b43d-3a03e2cb5fae", + "as": "GiteaPower" + }, + "use_selection5": { + "use": "6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c", + "as": "GiteaUtilities" + } + }, + "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Factory", + "description": "Joomla Power Factory\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": "use Joomla\\DI\\Container;", + "composer": "" +} \ No newline at end of file diff --git a/src/763d137c-42bc-4282-98d8-cc5c0654985f/README.md b/src/763d137c-42bc-4282-98d8-cc5c0654985f/README.md index e4837ed..f0ca487 100644 --- a/src/763d137c-42bc-4282-98d8-cc5c0654985f/README.md +++ b/src/763d137c-42bc-4282-98d8-cc5c0654985f/README.md @@ -6,11 +6,11 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# final class Injector (Details) +# class Injector (Details) > namespace: **VDM\Joomla\Componentbuilder\Compiler\Power** ```uml @startuml -class Injector << (F,LightGreen) >> #RoyalBlue { +class Injector #Gold { # Power $power # Extractor $extractor # Parser $parser @@ -20,7 +20,7 @@ class Injector << (F,LightGreen) >> #RoyalBlue { # array $traits # array $other # array $duplicate - + __construct(?Power $power = null, ?Extractor $extractor = null, ...) + + __construct(Power $power = null, Extractor $extractor = null, ...) + power(string $code) : string # update(array $guids, string $code) : string # inspect(object $power, ?array $useStatements, ...) : ?string @@ -45,10 +45,10 @@ note right of Injector::__construct since: 3.2.0 arguments: - ?Power $power = null - ?Extractor $extractor = null - ?Parser $parser = null - ?Placeholder $placeholder = null + Power $power = null + Extractor $extractor = null + Parser $parser = null + Placeholder $placeholder = null end note note left of Injector::power diff --git a/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php b/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php index 246a7ac..51a0663 100644 --- a/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php +++ b/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.php @@ -12,18 +12,18 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Power; -use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; -use VDM\Joomla\Componentbuilder\Compiler\Power; -use VDM\Joomla\Componentbuilder\Compiler\Power\Extractor; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\PowerInterface as Power; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power\ExtractorInterface as Extractor; use VDM\Joomla\Componentbuilder\Compiler\Power\Parser; use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power\InjectorInterface; /** * Compiler Power Injector * @since 3.2.0 */ -final class Injector +class Injector implements InjectorInterface { /** * Power Objects @@ -107,13 +107,13 @@ final class Injector * * @since 3.2.0 */ - public function __construct(?Power $power = null, ?Extractor $extractor = null, - ?Parser $parser = null, ?Placeholder $placeholder = null) + public function __construct(Power $power = null, Extractor $extractor = null, + Parser $parser = null, Placeholder $placeholder = null) { - $this->power = $power ?: Compiler::_('Power'); - $this->extractor = $extractor ?: Compiler::_('Power.Extractor'); - $this->parser = $parser ?: Compiler::_('Power.Parser'); - $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->power = $power; + $this->extractor = $extractor; + $this->parser = $parser; + $this->placeholder = $placeholder; } /** diff --git a/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.power b/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.power index f18fec7..bd84e86 100644 --- a/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.power +++ b/src/763d137c-42bc-4282-98d8-cc5c0654985f/code.power @@ -80,13 +80,13 @@ * * @since 3.2.0 */ - public function __construct(?Power $power = null, ?Extractor $extractor = null, - ?Parser $parser = null, ?Placeholder $placeholder = null) + public function __construct(Power $power = null, Extractor $extractor = null, + Parser $parser = null, Placeholder $placeholder = null) { - $this->power = $power ?: Compiler::_('Power'); - $this->extractor = $extractor ?: Compiler::_('Power.Extractor'); - $this->parser = $parser ?: Compiler::_('Power.Parser'); - $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->power = $power; + $this->extractor = $extractor; + $this->parser = $parser; + $this->placeholder = $placeholder; } /** diff --git a/src/763d137c-42bc-4282-98d8-cc5c0654985f/settings.json b/src/763d137c-42bc-4282-98d8-cc5c0654985f/settings.json index 314e8e8..5814d71 100644 --- a/src/763d137c-42bc-4282-98d8-cc5c0654985f/settings.json +++ b/src/763d137c-42bc-4282-98d8-cc5c0654985f/settings.json @@ -3,30 +3,28 @@ "add_licensing_template": "2", "extends": "0", "guid": "763d137c-42bc-4282-98d8-cc5c0654985f", - "implements": null, + "implements": [ + "e923311a-4058-4e81-9f67-5956fd0c627c" + ], "load_selection": null, "name": "Injector", "power_version": "1.0.0", "system_name": "JCB.Compiler.Power.Injector", - "type": "final class", + "type": "class", "use_selection": { "use_selection0": { - "use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac", - "as": "Compiler" + "use": "1133c2d7-ba7e-4c95-8cde-01f084d04682", + "as": "Power" }, "use_selection1": { - "use": "b836c1b1-b6b1-44f7-b8a2-9a763a4185b1", - "as": "default" + "use": "c159425c-51f9-4a15-af99-f2d0c6d7aae8", + "as": "Extractor" }, "use_selection2": { - "use": "eeb03266-22fd-45bb-953a-961bb6be3a54", - "as": "default" - }, - "use_selection3": { "use": "95d0e03f-24fd-4412-bc2e-f0899fcc3205", "as": "default" }, - "use_selection4": { + "use_selection3": { "use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c", "as": "default" } diff --git a/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/README.md b/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/README.md index c431d61..6a069eb 100644 --- a/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/README.md +++ b/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/README.md @@ -6,12 +6,12 @@ ██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ``` -# final class Upsert (Details) +# class Upsert (Details) > namespace: **VDM\Joomla\Componentbuilder\Power\Model** > extends: **AbstractionModel** ```uml @startuml -class Upsert << (F,LightGreen) >> #RoyalBlue { +class Upsert #Gold { + value(mixed $value, string $field, ...) : mixed # validateBefore(mixed $value, ?string $field = null, ...) : bool # validateAfter(mixed $value, ?string $field = null, ...) : bool diff --git a/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/code.php b/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/code.php index 607b5ca..f6862e1 100644 --- a/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/code.php +++ b/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/code.php @@ -24,7 +24,7 @@ use VDM\Joomla\Interfaces\ModelInterface; * * @since 3.2.0 */ -final class Upsert extends AbstractionModel implements ModelInterface +class Upsert extends AbstractionModel implements ModelInterface { /** * Model the value diff --git a/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/settings.json b/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/settings.json index e371e35..277a60f 100644 --- a/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/settings.json +++ b/src/7c1fb50f-8fb1-4627-8705-6fedf7182ca5/settings.json @@ -10,7 +10,7 @@ "name": "Upsert", "power_version": "1.0.0", "system_name": "JCB.Power.Model.Upsert", - "type": "final class", + "type": "class", "use_selection": { "use_selection0": { "use": "584747d1-3a86-453d-b7a3-a2219de8d777", diff --git a/src/82505f3f-297f-4d75-a581-929ab3e93689/README.md b/src/82505f3f-297f-4d75-a581-929ab3e93689/README.md new file mode 100644 index 0000000..973b5be --- /dev/null +++ b/src/82505f3f-297f-4d75-a581-929ab3e93689/README.md @@ -0,0 +1,47 @@ +``` +██████╗ ██████╗ ██╗ ██╗███████╗██████╗ +██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗ +██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝ +██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗ +██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ +``` +# final class Extractor (Details) +> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaPower** +> extends: **Extractor** +```uml +@startuml +class Extractor << (F,LightGreen) >> #RoyalBlue { + # string $table + # $targetVersion + + __construct(int $targetVersion) + # namespaces(array $guids) : ?array +} + +note right of Extractor::__construct + Constructor. + + since: 3.2.1 +end note + +note right of Extractor::namespaces + Get the complete namespace strings of the guids passed as an array. + + since: 3.2.0 + return: ?array +end note + +@enduml +``` + +--- +``` + ██╗ ██████╗██████╗ + ██║██╔════╝██╔══██╗ + ██║██║ ██████╔╝ +██ ██║██║ ██╔══██╗ +╚█████╔╝╚██████╗██████╔╝ + ╚════╝ ╚═════╝╚═════╝ +``` +> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder) + diff --git a/src/82505f3f-297f-4d75-a581-929ab3e93689/code.php b/src/82505f3f-297f-4d75-a581-929ab3e93689/code.php new file mode 100644 index 0000000..0e574ad --- /dev/null +++ b/src/82505f3f-297f-4d75-a581-929ab3e93689/code.php @@ -0,0 +1,118 @@ + + * @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\Compiler\JoomlaPower; + + +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power\ExtractorInterface; +use VDM\Joomla\Componentbuilder\Compiler\Power\Extractor; + + +/** + * Compiler Joomla Power Extractor + * @since 3.2.1 + */ +final class Extractor extends Extractor implements ExtractorInterface +{ + /** + * The pattern to get the powers + * + * @var string + * @since 3.2.0 + **/ + protected string $pattern = '/Joomla_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/'; + + /** + * The pattern to get the Front + * + * @var string + * @since 3.2.1 + **/ + protected string $_pattern = 'Joomla'; + + /** + * The pattern to get the Back + * + * @var string + * @since 3.2.1 + **/ + protected string $pattern_ = 'Power'; + + /** + * The Table + * + * @var string + * @since 3.2.1 + **/ + protected string $table = 'joomla_power'; + + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + + /** + * Constructor. + * + * @param int $targetVersion The targeted Joomla version. + * + * @since 3.2.1 + */ + public function __construct(int $targetVersion) + { + parent::__construct(); + + $this->targetVersion = $targetVersion; + } + + /** + * Get the complete namespace strings of the guids passed as an array. + * + * @param array $guids The guids to filter the results + * + * @return array|null The result namespaces with their guids + * @since 3.2.0 + **/ + protected function namespaces(array $guids): ?array + { + $query = $this->db->getQuery(true); + $query->select($this->db->quoteName(['settings', 'guid'])) + ->from($this->db->quoteName('#__componentbuilder_' . $this->table)) + ->where($this->db->quoteName('guid') . ' IN (' . implode(',', array_map([$this->db, 'quote'], $guids)) . ')'); + $this->db->setQuery($query); + $this->db->execute(); + + if ($this->db->getNumRows()) + { + $namespaces = []; + $items = $this->db->loadAssocList(); + foreach ($items as $item) + { + if (JsonHelper::check($item->settings)) + { + $item->settings = json_decode($item->settings, true); + echo '
'; var_dump($item->settings, 'Joomla Version: ' . $this->targetVersion); exit;
+				}
+			}
+
+			if ($namespaces !== [])
+			{
+				return $namespaces;
+			}
+		}
+
+		return null;
+	}
+}
+
diff --git a/src/82505f3f-297f-4d75-a581-929ab3e93689/code.power b/src/82505f3f-297f-4d75-a581-929ab3e93689/code.power
new file mode 100644
index 0000000..eea8ea6
--- /dev/null
+++ b/src/82505f3f-297f-4d75-a581-929ab3e93689/code.power
@@ -0,0 +1,92 @@
+	/**
+	 * The pattern to get the powers
+	 *
+	 * @var    string
+	 * @since 3.2.0
+	 **/
+	protected string $pattern = '/Joomla_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
+
+	/**
+	 * The pattern to get the Front
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $_pattern = 'Joomla';
+
+	/**
+	 * The pattern to get the Back
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $pattern_ = 'Power';
+
+	/**
+	 * The Table
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $table = 'joomla_power';
+
+	/**
+	 * Current Joomla Version Being Build
+	 *
+	 * @var     int
+	 * @since 3.2.0
+	 **/
+	protected $targetVersion;
+
+	/**
+	 * Constructor.
+	 *
+	 * @param int    $targetVersion   The targeted Joomla version.
+	 *
+	 * @since 3.2.1
+	 */
+	public function __construct(int $targetVersion)
+	{
+		parent::__construct();
+
+		$this->targetVersion = $targetVersion;
+	}
+
+	/**
+	 * Get the complete namespace strings of the guids passed as an array.
+	 *
+	 * @param array $guids The guids to filter the results
+	 *
+	 * @return array|null The result namespaces with their guids
+	 * @since 3.2.0
+	 **/
+	protected function namespaces(array $guids): ?array
+	{
+		$query = $this->db->getQuery(true);
+		$query->select($this->db->quoteName(['settings', 'guid']))
+			->from($this->db->quoteName('#__componentbuilder_' . $this->table))
+			->where($this->db->quoteName('guid') . ' IN (' . implode(',', array_map([$this->db, 'quote'], $guids)) . ')');
+		$this->db->setQuery($query);
+		$this->db->execute();
+
+		if ($this->db->getNumRows())
+		{
+			$namespaces = [];
+			$items = $this->db->loadAssocList();
+			foreach ($items as $item)
+			{
+				if (JsonHelper::check($item->settings))
+				{
+					$item->settings = json_decode($item->settings, true);
+					echo '
'; var_dump($item->settings, 'Joomla Version: ' . $this->targetVersion); exit;
+				}
+			}
+
+			if ($namespaces !== [])
+			{
+				return $namespaces;
+			}
+		}
+
+		return null;
+	}
\ No newline at end of file
diff --git a/src/82505f3f-297f-4d75-a581-929ab3e93689/settings.json b/src/82505f3f-297f-4d75-a581-929ab3e93689/settings.json
new file mode 100644
index 0000000..1f139de
--- /dev/null
+++ b/src/82505f3f-297f-4d75-a581-929ab3e93689/settings.json
@@ -0,0 +1,20 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "eeb03266-22fd-45bb-953a-961bb6be3a54",
+    "guid": "82505f3f-297f-4d75-a581-929ab3e93689",
+    "implements": [
+        "c159425c-51f9-4a15-af99-f2d0c6d7aae8"
+    ],
+    "load_selection": null,
+    "name": "Extractor",
+    "power_version": "1.0.0",
+    "system_name": "JCB.Compiler.JoomlaPower.Extractor",
+    "type": "final class",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaPower.Extractor",
+    "description": "Compiler Joomla Power Extractor\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": ""
+}
\ No newline at end of file
diff --git a/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/README.md b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/README.md
new file mode 100644
index 0000000..61f6fa3
--- /dev/null
+++ b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/README.md
@@ -0,0 +1,38 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# final class Upsert (Details)
+> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower\Model**
+> extends: **Upsert**
+```uml
+@startuml
+class Upsert << (F,LightGreen) >> #RoyalBlue {
+  # getTable() : string
+}
+
+note right of Upsert::getTable
+  Get the current active table
+
+  since: 3.2.0
+  return: string
+end note
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php
new file mode 100644
index 0000000..5160329
--- /dev/null
+++ b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.php
@@ -0,0 +1,38 @@
+
+ * @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\JoomlaPower\Model;
+
+
+use VDM\Joomla\Interfaces\ModelInterface;
+use VDM\Joomla\Componentbuilder\Power\Model\Upsert;
+
+
+/**
+ * Joomla Power Model Update or Insert
+ * 
+ * @since 3.2.0
+ */
+final class Upsert extends Upsert implements ModelInterface
+{
+	/**
+	 * Get the current active table
+	 *
+	 * @return  string
+	 * @since 3.2.0
+	 */
+	protected function getTable(): string
+	{
+		return 'joomla_power';
+	}
+
+}
+
diff --git a/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.power b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.power
new file mode 100644
index 0000000..2c16943
--- /dev/null
+++ b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/code.power
@@ -0,0 +1,10 @@
+	/**
+	 * Get the current active table
+	 *
+	 * @return  string
+	 * @since 3.2.0
+	 */
+	protected function getTable(): string
+	{
+		return 'joomla_power';
+	}
diff --git a/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/settings.json b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/settings.json
new file mode 100644
index 0000000..ec2efe3
--- /dev/null
+++ b/src/9206082e-a3f7-472e-98b2-de90d06cbdcd/settings.json
@@ -0,0 +1,20 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "7c1fb50f-8fb1-4627-8705-6fedf7182ca5",
+    "guid": "9206082e-a3f7-472e-98b2-de90d06cbdcd",
+    "implements": [
+        "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff"
+    ],
+    "load_selection": null,
+    "name": "Upsert",
+    "power_version": "1.0.0",
+    "system_name": "JCB.JoomlaPower.Model.Upsert",
+    "type": "final class",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Model.Upsert",
+    "description": "Joomla Power Model Update or Insert\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/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/README.md b/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/README.md
new file mode 100644
index 0000000..801a32a
--- /dev/null
+++ b/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/README.md
@@ -0,0 +1,80 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# interface InsertInterface (Details)
+> namespace: **VDM\Joomla\Componentbuilder\Interfaces\Database**
+```uml
+@startuml
+interface InsertInterface  #Lavender {
+  + 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 InsertInterface::value
+  Insert a value to a given table
+Example: $this->value(Value, 'value_key', 'GUID');
+
+  since: 3.2.0
+  return: bool
+  
+  arguments:
+    mixed $value
+    string $field
+    string $keyValue
+    string $key = 'guid'
+end note
+
+note right of InsertInterface::row
+  Insert single row with multiple values to a given table
+Example: $this->item(Array);
+
+  since: 3.2.0
+  return: bool
+end note
+
+note right of InsertInterface::rows
+  Insert multiple rows to a given table
+Example: $this->items(Array);
+
+  since: 3.2.0
+  return: bool
+end note
+
+note right of InsertInterface::item
+  Insert single item with multiple values to a given table
+Example: $this->item(Object);
+
+  since: 3.2.0
+  return: bool
+end note
+
+note right of InsertInterface::items
+  Insert multiple items to a given table
+Example: $this->items(Array);
+
+  since: 3.2.0
+  return: bool
+end note
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/code.php b/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/code.php
new file mode 100644
index 0000000..57a83d1
--- /dev/null
+++ b/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/code.php
@@ -0,0 +1,81 @@
+
+ * @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;
+
+
+/**
+ * Database Insert
+ * 
+ * @since 3.2.1
+ */
+interface InsertInterface
+{
+	/**
+	 * 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 3.2.0
+	 */
+	public function value($value, string $field, string $keyValue, string $key = 'guid'): bool;
+
+	/**
+	 * Insert single row with multiple values to a given table
+	 *          Example: $this->item(Array);
+	 *
+	 * @param   array    $item   The item to save
+	 *
+	 * @return  bool
+	 * @since 3.2.0
+	 */
+	public function row(array $item): bool;
+
+	/**
+	 * 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 3.2.0
+	 */
+	public function rows(?array $items): bool;
+
+	/**
+	 * Insert single item with multiple values to a given table
+	 *          Example: $this->item(Object);
+	 *
+	 * @param   object    $item   The item to save
+	 *
+	 * @return  bool
+	 * @since 3.2.0
+	 */
+	public function item(object $item): bool;
+
+	/**
+	 * 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 3.2.0
+	 */
+	public function items(?array $items): bool;
+
+}
+
diff --git a/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/code.power b/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/code.power
new file mode 100644
index 0000000..7bf5f4f
--- /dev/null
+++ b/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/code.power
@@ -0,0 +1,57 @@
+	/**
+	 * 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 3.2.0
+	 */
+	public function value($value, string $field, string $keyValue, string $key = 'guid'): bool;
+
+	/**
+	 * Insert single row with multiple values to a given table
+	 *          Example: $this->item(Array);
+	 *
+	 * @param   array    $item   The item to save
+	 *
+	 * @return  bool
+	 * @since 3.2.0
+	 */
+	public function row(array $item): bool;
+
+	/**
+	 * 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 3.2.0
+	 */
+	public function rows(?array $items): bool;
+
+	/**
+	 * Insert single item with multiple values to a given table
+	 *          Example: $this->item(Object);
+	 *
+	 * @param   object    $item   The item to save
+	 *
+	 * @return  bool
+	 * @since 3.2.0
+	 */
+	public function item(object $item): bool;
+
+	/**
+	 * 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 3.2.0
+	 */
+	public function items(?array $items): bool;
diff --git a/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/settings.json b/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/settings.json
new file mode 100644
index 0000000..5718028
--- /dev/null
+++ b/src/95c02df3-fe0a-405b-b506-b7a5b8605b66/settings.json
@@ -0,0 +1,18 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "0",
+    "guid": "95c02df3-fe0a-405b-b506-b7a5b8605b66",
+    "implements": null,
+    "load_selection": null,
+    "name": "InsertInterface",
+    "power_version": "1.0.0",
+    "system_name": "JCB.Interfaces.Database.InsertInterface",
+    "type": "interface",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.Database.InsertInterface",
+    "description": "Database Insert\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": ""
+}
\ No newline at end of file
diff --git a/src/99786f53-64b7-4d52-95b0-5306e7386c3f/README.md b/src/99786f53-64b7-4d52-95b0-5306e7386c3f/README.md
new file mode 100644
index 0000000..998eb46
--- /dev/null
+++ b/src/99786f53-64b7-4d52-95b0-5306e7386c3f/README.md
@@ -0,0 +1,72 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# interface LoadInterface (Details)
+> namespace: **VDM\Joomla\Componentbuilder\Power\Database**
+```uml
+@startuml
+interface LoadInterface  #Lavender {
+  + value(array $keys, string $field) : mixed
+  + item(array $keys) : ?object
+  + items(array $keys) : ?array
+}
+
+note right of LoadInterface::value
+  Get a value from a given table
+Example: $this->value(
+[
+'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
+], 'value_key'
+);
+
+  since: 2.0.1
+  return: mixed
+end note
+
+note right of LoadInterface::item
+  Get values from a given table
+Example: $this->item(
+[
+'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
+]
+);
+
+  since: 2.0.1
+  return: ?object
+end note
+
+note right of LoadInterface::items
+  Get values from a given table
+Example: $this->items(
+[
+'guid' => [
+'operator' => 'IN',
+'value' => [''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'', ''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'']
+]
+]
+);
+Example: $this->items($ids, 'table_name');
+
+  since: 2.0.1
+  return: ?array
+end note
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/99786f53-64b7-4d52-95b0-5306e7386c3f/code.php b/src/99786f53-64b7-4d52-95b0-5306e7386c3f/code.php
new file mode 100644
index 0000000..60d166f
--- /dev/null
+++ b/src/99786f53-64b7-4d52-95b0-5306e7386c3f/code.php
@@ -0,0 +1,75 @@
+
+ * @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\Power\Database;
+
+
+/**
+ * Power Database Load
+ * 
+ * @since 2.0.1
+ */
+interface LoadInterface
+{
+	/**
+	 * Get a value from a given table
+	 *          Example: $this->value(
+	 *                        [
+	 *                           'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
+	 *                        ], 'value_key'
+	 *                    );
+	 *
+	 * @param   array      $keys      The item keys
+	 * @param   string     $field     The field key
+	 * @param   string     $table     The table
+	 *
+	 * @return  mixed
+	 * @since 2.0.1
+	 */
+	public function value(array $keys, string $field);
+
+	/**
+	 * Get values from a given table
+	 *          Example: $this->item(
+	 *                        [
+	 *                           'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
+	 *                        ]
+	 *                    );
+	 *
+	 * @param   array    $keys      The item keys
+	 * @param   string   $table     The table
+	 *
+	 * @return  object|null
+	 * @since 2.0.1
+	 */
+	public function item(array $keys): ?object;
+ 
+	/**
+	 * Get values from a given table
+	 *          Example: $this->items(
+	 *                        [
+	 *                           'guid' => [
+	 *                              'operator' => 'IN',
+	 *                              'value' => [''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'', ''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'']
+	 *                           ]
+	 *                        ]
+	 *                    );
+	 *          Example: $this->items($ids, 'table_name');
+	 *
+	 * @param   array    $keys    The item keys
+	 * @param   string   $table   The table
+	 *
+	 * @return  array|null
+	 * @since 2.0.1
+	 */
+	public function items(array $keys): ?array;
+}
+
diff --git a/src/99786f53-64b7-4d52-95b0-5306e7386c3f/code.power b/src/99786f53-64b7-4d52-95b0-5306e7386c3f/code.power
new file mode 100644
index 0000000..05b4746
--- /dev/null
+++ b/src/99786f53-64b7-4d52-95b0-5306e7386c3f/code.power
@@ -0,0 +1,52 @@
+	/**
+	 * Get a value from a given table
+	 *          Example: $this->value(
+	 *                        [
+	 *                           'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
+	 *                        ], 'value_key'
+	 *                    );
+	 *
+	 * @param   array      $keys      The item keys
+	 * @param   string     $field     The field key
+	 * @param   string     $table     The table
+	 *
+	 * @return  mixed
+	 * @since 2.0.1
+	 */
+	public function value(array $keys, string $field);
+
+	/**
+	 * Get values from a given table
+	 *          Example: $this->item(
+	 *                        [
+	 *                           'guid' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
+	 *                        ]
+	 *                    );
+	 *
+	 * @param   array    $keys      The item keys
+	 * @param   string   $table     The table
+	 *
+	 * @return  object|null
+	 * @since 2.0.1
+	 */
+	public function item(array $keys): ?object;
+ 
+	/**
+	 * Get values from a given table
+	 *          Example: $this->items(
+	 *                        [
+	 *                           'guid' => [
+	 *                              'operator' => 'IN',
+	 *                              'value' => [''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'', ''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'']
+	 *                           ]
+	 *                        ]
+	 *                    );
+	 *          Example: $this->items($ids, 'table_name');
+	 *
+	 * @param   array    $keys    The item keys
+	 * @param   string   $table   The table
+	 *
+	 * @return  array|null
+	 * @since 2.0.1
+	 */
+	public function items(array $keys): ?array;
\ No newline at end of file
diff --git a/src/99786f53-64b7-4d52-95b0-5306e7386c3f/settings.json b/src/99786f53-64b7-4d52-95b0-5306e7386c3f/settings.json
new file mode 100644
index 0000000..5344cd3
--- /dev/null
+++ b/src/99786f53-64b7-4d52-95b0-5306e7386c3f/settings.json
@@ -0,0 +1,18 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "0",
+    "guid": "99786f53-64b7-4d52-95b0-5306e7386c3f",
+    "implements": null,
+    "load_selection": null,
+    "name": "LoadInterface",
+    "power_version": "1.0.0",
+    "system_name": "JCB.Interfaces.Database.LoadInterface",
+    "type": "interface",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.Power.Database.LoadInterface",
+    "description": "Power Database Load\r\n\r\n@since 2.0.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": ""
+}
\ No newline at end of file
diff --git a/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/README.md b/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/README.md
new file mode 100644
index 0000000..8d6df57
--- /dev/null
+++ b/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/README.md
@@ -0,0 +1,31 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# final class Insert (Details)
+> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower\Database**
+> extends: **Insert**
+```uml
+@startuml
+class Insert << (F,LightGreen) >> #RoyalBlue {
+  # string $table
+}
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/code.php b/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/code.php
new file mode 100644
index 0000000..845a62c
--- /dev/null
+++ b/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/code.php
@@ -0,0 +1,34 @@
+
+ * @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\JoomlaPower\Database;
+
+
+use VDM\Joomla\Componentbuilder\Interfaces\Database\InsertInterface;
+use VDM\Joomla\Componentbuilder\Power\Database\Insert;
+
+
+/**
+ * Joomla Power Database Insert
+ * 
+ * @since 3.2.1
+ */
+final class Insert extends Insert implements InsertInterface
+{
+	/**
+	 * Table Name
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 */
+	protected string $table = 'power';
+}
+
diff --git a/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/code.power b/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/code.power
new file mode 100644
index 0000000..e2209eb
--- /dev/null
+++ b/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/code.power
@@ -0,0 +1,7 @@
+	/**
+	 * Table Name
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 */
+	protected string $table = 'power';
\ No newline at end of file
diff --git a/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/settings.json b/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/settings.json
new file mode 100644
index 0000000..e8cca6e
--- /dev/null
+++ b/src/9d53d45e-9b4d-45ec-827b-4916b91c907e/settings.json
@@ -0,0 +1,20 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "380bb7a3-cdcc-4336-a699-5070cbf521a5",
+    "guid": "9d53d45e-9b4d-45ec-827b-4916b91c907e",
+    "implements": [
+        "95c02df3-fe0a-405b-b506-b7a5b8605b66"
+    ],
+    "load_selection": null,
+    "name": "Insert",
+    "power_version": "1.0.0",
+    "system_name": "JCB.JoomlaPower.Database.Insert",
+    "type": "final class",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Database.Insert",
+    "description": "Joomla Power Database Insert\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": ""
+}
\ No newline at end of file
diff --git a/src/a2992a91-eec2-4957-811b-8cde22aa1438/README.md b/src/a2992a91-eec2-4957-811b-8cde22aa1438/README.md
new file mode 100644
index 0000000..a08063d
--- /dev/null
+++ b/src/a2992a91-eec2-4957-811b-8cde22aa1438/README.md
@@ -0,0 +1,77 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# class Database (Details)
+> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower\Service**
+```uml
+@startuml
+class Database  #Gold {
+  + register(Container $container) : void
+  + getModelLoad(Container $container) : ModelLoad
+  + getModelUpsert(Container $container) : ModelUpsert
+  + getLoadDatabase(Container $container) : LoadDatabase
+  + getInsertDatabase(Container $container) : InsertDatabase
+  + getUpdateDatabase(Container $container) : UpdateDatabase
+}
+
+note right of Database::register
+  Registers the service provider with a DI container.
+
+  since: 3.2.0
+  return: void
+end note
+
+note right of Database::getModelLoad
+  Get the Power Model Load
+
+  since: 3.2.0
+  return: ModelLoad
+end note
+
+note right of Database::getModelUpsert
+  Get the Power Model Update or Insert
+
+  since: 3.2.0
+  return: ModelUpsert
+end note
+
+note right of Database::getLoadDatabase
+  Get the Load Database
+
+  since: 3.2.0
+  return: LoadDatabase
+end note
+
+note right of Database::getInsertDatabase
+  Get the Insert Database
+
+  since: 3.2.0
+  return: InsertDatabase
+end note
+
+note right of Database::getUpdateDatabase
+  Get the Update Database
+
+  since: 3.2.0
+  return: UpdateDatabase
+end note
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/a2992a91-eec2-4957-811b-8cde22aa1438/code.php b/src/a2992a91-eec2-4957-811b-8cde22aa1438/code.php
new file mode 100644
index 0000000..06524ad
--- /dev/null
+++ b/src/a2992a91-eec2-4957-811b-8cde22aa1438/code.php
@@ -0,0 +1,135 @@
+
+ * @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\JoomlaPower\Service;
+
+
+use Joomla\DI\Container;
+use Joomla\DI\ServiceProviderInterface;
+use VDM\Joomla\Componentbuilder\JoomlaPower\Model\Load as ModelLoad;
+use VDM\Joomla\Componentbuilder\JoomlaPower\Model\Upsert as ModelUpsert;
+use VDM\Joomla\Componentbuilder\JoomlaPower\Database\Load as LoadDatabase;
+use VDM\Joomla\Componentbuilder\JoomlaPower\Database\Insert as InsertDatabase;
+use VDM\Joomla\Componentbuilder\JoomlaPower\Database\Update as UpdateDatabase;
+
+
+/**
+ * Database Service Provider
+ * 
+ * @since 3.2.0
+ */
+class Database implements ServiceProviderInterface
+{
+	/**
+	 * Registers the service provider with a DI container.
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  void
+	 * @since 3.2.0
+	 */
+	public function register(Container $container)
+	{
+		$container->alias(ModelLoad::class, 'Joomla.Power.Model.Load')
+			->share('Joomla.Power.Model.Load', [$this, 'getModelLoad'], true);
+
+		$container->alias(ModelUpsert::class, 'Joomla.Power.Model.Upsert')
+			->share('Joomla.Power.Model.Upsert', [$this, 'getModelUpsert'], true);
+
+		$container->alias(LoadDatabase::class, 'Joomla.Power.Database.Load')
+			->share('Joomla.Power.Database.Load', [$this, 'getLoadDatabase'], true);
+
+		$container->alias(InsertDatabase::class, 'Joomla.Power.Database.Insert')
+			->share('Joomla.Power.Database.Insert', [$this, 'getInsertDatabase'], true);
+
+		$container->alias(UpdateDatabase::class, 'Joomla.Power.Database.Update')
+			->share('Joomla.Power.Database.Update', [$this, 'getUpdateDatabase'], true);
+	}
+
+	/**
+	 * Get the Power Model Load
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  ModelLoad
+	 * @since 3.2.0
+	 */
+	public function getModelLoad(Container $container): ModelLoad
+	{
+		return new ModelLoad(
+			$container->get('Table')
+		);
+	}
+
+	/**
+	 * Get the Power Model Update or Insert
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  ModelUpsert
+	 * @since 3.2.0
+	 */
+	public function getModelUpsert(Container $container): ModelUpsert
+	{
+		return new ModelUpsert(
+			$container->get('Table')
+		);
+	}
+
+	/**
+	 * Get the Load Database
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  LoadDatabase
+	 * @since 3.2.0
+	 */
+	public function getLoadDatabase(Container $container): LoadDatabase
+	{
+		return new LoadDatabase(
+			$container->get('Joomla.Power.Model.Load'),
+			$container->get('Load')
+		);
+	}
+
+	/**
+	 * Get the Insert Database
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  InsertDatabase
+	 * @since 3.2.0
+	 */
+	public function getInsertDatabase(Container $container): InsertDatabase
+	{
+		return new InsertDatabase(
+			$container->get('Joomla.Power.Model.Upsert'),
+			$container->get('Insert')
+		);
+	}
+
+	/**
+	 * Get the Update Database
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  UpdateDatabase
+	 * @since 3.2.0
+	 */
+	public function getUpdateDatabase(Container $container): UpdateDatabase
+	{
+		return new UpdateDatabase(
+			$container->get('Joomla.Power.Model.Upsert'),
+			$container->get('Update')
+		);
+	}
+}
+
diff --git a/src/a2992a91-eec2-4957-811b-8cde22aa1438/code.power b/src/a2992a91-eec2-4957-811b-8cde22aa1438/code.power
new file mode 100644
index 0000000..8a34d8d
--- /dev/null
+++ b/src/a2992a91-eec2-4957-811b-8cde22aa1438/code.power
@@ -0,0 +1,103 @@
+	/**
+	 * Registers the service provider with a DI container.
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  void
+	 * @since 3.2.0
+	 */
+	public function register(Container $container)
+	{
+		$container->alias(ModelLoad::class, 'Joomla.Power.Model.Load')
+			->share('Joomla.Power.Model.Load', [$this, 'getModelLoad'], true);
+
+		$container->alias(ModelUpsert::class, 'Joomla.Power.Model.Upsert')
+			->share('Joomla.Power.Model.Upsert', [$this, 'getModelUpsert'], true);
+
+		$container->alias(LoadDatabase::class, 'Joomla.Power.Database.Load')
+			->share('Joomla.Power.Database.Load', [$this, 'getLoadDatabase'], true);
+
+		$container->alias(InsertDatabase::class, 'Joomla.Power.Database.Insert')
+			->share('Joomla.Power.Database.Insert', [$this, 'getInsertDatabase'], true);
+
+		$container->alias(UpdateDatabase::class, 'Joomla.Power.Database.Update')
+			->share('Joomla.Power.Database.Update', [$this, 'getUpdateDatabase'], true);
+	}
+
+	/**
+	 * Get the Power Model Load
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  ModelLoad
+	 * @since 3.2.0
+	 */
+	public function getModelLoad(Container $container): ModelLoad
+	{
+		return new ModelLoad(
+			$container->get('Table')
+		);
+	}
+
+	/**
+	 * Get the Power Model Update or Insert
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  ModelUpsert
+	 * @since 3.2.0
+	 */
+	public function getModelUpsert(Container $container): ModelUpsert
+	{
+		return new ModelUpsert(
+			$container->get('Table')
+		);
+	}
+
+	/**
+	 * Get the Load Database
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  LoadDatabase
+	 * @since 3.2.0
+	 */
+	public function getLoadDatabase(Container $container): LoadDatabase
+	{
+		return new LoadDatabase(
+			$container->get('Joomla.Power.Model.Load'),
+			$container->get('Load')
+		);
+	}
+
+	/**
+	 * Get the Insert Database
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  InsertDatabase
+	 * @since 3.2.0
+	 */
+	public function getInsertDatabase(Container $container): InsertDatabase
+	{
+		return new InsertDatabase(
+			$container->get('Joomla.Power.Model.Upsert'),
+			$container->get('Insert')
+		);
+	}
+
+	/**
+	 * Get the Update Database
+	 *
+	 * @param   Container  $container  The DI container.
+	 *
+	 * @return  UpdateDatabase
+	 * @since 3.2.0
+	 */
+	public function getUpdateDatabase(Container $container): UpdateDatabase
+	{
+		return new UpdateDatabase(
+			$container->get('Joomla.Power.Model.Upsert'),
+			$container->get('Update')
+		);
+	}
\ No newline at end of file
diff --git a/src/a2992a91-eec2-4957-811b-8cde22aa1438/settings.json b/src/a2992a91-eec2-4957-811b-8cde22aa1438/settings.json
new file mode 100644
index 0000000..6c29304
--- /dev/null
+++ b/src/a2992a91-eec2-4957-811b-8cde22aa1438/settings.json
@@ -0,0 +1,42 @@
+{
+    "add_head": "1",
+    "add_licensing_template": "2",
+    "extends": "0",
+    "guid": "a2992a91-eec2-4957-811b-8cde22aa1438",
+    "implements": [
+        "-1"
+    ],
+    "load_selection": null,
+    "name": "Database",
+    "power_version": "1.0.0",
+    "system_name": "JCB.JoomlaPower.Service.Database",
+    "type": "class",
+    "use_selection": {
+        "use_selection0": {
+            "use": "05744dd3-4030-4cf8-8dda-a93ab809b473",
+            "as": "ModelLoad"
+        },
+        "use_selection1": {
+            "use": "9206082e-a3f7-472e-98b2-de90d06cbdcd",
+            "as": "ModelUpsert"
+        },
+        "use_selection2": {
+            "use": "b4ea5de3-653f-43f9-b927-4ba6456b4d0a",
+            "as": "LoadDatabase"
+        },
+        "use_selection3": {
+            "use": "9d53d45e-9b4d-45ec-827b-4916b91c907e",
+            "as": "InsertDatabase"
+        },
+        "use_selection4": {
+            "use": "679473f6-3ea2-49d5-8273-1b29c8f0ad2b",
+            "as": "UpdateDatabase"
+        }
+    },
+    "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Service.Database",
+    "description": "Database Service Provider\r\n\r\n@since 3.2.0",
+    "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/a6052fe9-0d2b-4b36-b3e7-03b47c483542/README.md b/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/README.md
new file mode 100644
index 0000000..fe9eb53
--- /dev/null
+++ b/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/README.md
@@ -0,0 +1,180 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# final class Injector (Details)
+> namespace: **VDM\Joomla\Componentbuilder\Compiler\JoomlaPower**
+> extends: **Injector**
+```uml
+@startuml
+class Injector << (F,LightGreen) >> #RoyalBlue {
+  # update(array $guids, string $code) : string
+  # inspect(object $power, ?array $useStatements, ...) : ?string
+  # buildNamespaceStatment(object $power) : string
+  # extractUseStatements(string $useStatement, string $className, ...) : array
+  # isUseStatementEqual(string $useStatement, string $namespaceStatement) : bool
+  # extractClassNameOrAlias(string $useStatement) : ?string
+  # getUniqueName(string $name, object $power) : string
+  # extractLastNameFromNamespace(string $namespace) : ?string
+  # removeLastNameFromNamespace(string $namespace) : string
+  # shouldAddTraitStatement(object $power) : bool
+  # handleTraitLogic(string $name, object $power, ...) : void
+  # addUseStatement(string $name, string $className, ...) : void
+  # addUseStatements(string $code, ?array $useStatements) : string
+  # addLines(string $code, string $lines) : string
+  # addLinesAfterDefinedLine(string $code, string $lines) : string
+}
+
+note right of Injector::update
+  Update the code
+
+  since: 3.2.0
+  return: string
+end note
+
+note left of Injector::inspect
+  Inspect the super power to determine the necessary class name based on use statements and traits.
+It checks if the given power (class, trait, etc.) already has a corresponding use statement
+and handles the naming accordingly to avoid conflicts.
+
+  since: 3.2.0
+  return: ?string
+  
+  arguments:
+    object $power
+    ?array $useStatements
+    ?array $traits
+end note
+
+note right of Injector::buildNamespaceStatment
+  Builds the namespace statement from the power object's namespace and class name.
+
+  since: 3.2.0
+  return: string
+end note
+
+note left of Injector::extractUseStatements
+  Extracts and processes use statements to find if the current class name is already used.
+It identifies any potential naming conflicts.
+
+  since: 3.2.0
+  return: array
+  
+  arguments:
+    string $useStatement
+    string $className
+    ?array $useStatements
+end note
+
+note right of Injector::isUseStatementEqual
+  Checks if the namespace statement is already declared in the current use statements.
+This method uses a regular expression to check for an exact match of the full statement,
+taking into account the possibility of an alias being used.
+
+  return: bool
+end note
+
+note left of Injector::extractClassNameOrAlias
+  Extracts the class name or alias from a use statement.
+This method parses a PHP 'use' statement and extracts either the class name or its alias.
+If the statement doesn't match the expected format, or if no class name or alias is found,
+the method returns null.
+Example:
+- 'use Namespace\ClassName;' -> returns 'ClassName'
+- 'use Namespace\ClassName as Alias;' -> returns 'Alias'
+
+  since: 3.2.0
+  return: ?string
+end note
+
+note right of Injector::getUniqueName
+  Ensures the name for the use statement is unique, avoiding conflicts with other classes.
+
+  since: 3.2.0
+  return: string
+end note
+
+note left of Injector::extractLastNameFromNamespace
+  Extracts the last part of a namespace string, which is typically the class name.
+
+  since: 3.2.0
+  return: ?string
+end note
+
+note right of Injector::removeLastNameFromNamespace
+  Removes the last name from the namespace.
+
+  since: 3.2.0
+  return: string
+end note
+
+note left of Injector::shouldAddTraitStatement
+  Determines whether a trait statement should be added.
+
+  since: 3.2.0
+  return: bool
+end note
+
+note right of Injector::handleTraitLogic
+  Handles specific logic for traits, such as checking if the trait is already used.
+
+  since: 3.2.0
+  return: void
+  
+  arguments:
+    string $name
+    object $power
+    ?array $traits
+end note
+
+note left of Injector::addUseStatement
+  Adds a use statement to the class if it's not already present.
+
+  since: 3.2.0
+  return: void
+  
+  arguments:
+    string $name
+    string $className
+    string $namespaceStatement
+end note
+
+note right of Injector::addUseStatements
+  Insert a line before the class declaration in the given class code.
+
+  since: 3.2.0
+  return: string
+end note
+
+note left of Injector::addLines
+  Insert a line before the class declaration in the given class code.
+
+  since: 3.2.0
+  return: string
+end note
+
+note right of Injector::addLinesAfterDefinedLine
+  Inserts a new line after the defined('_JEXEC') line.
+
+  since: 3.2.0
+  return: string
+end note
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/code.php b/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/code.php
new file mode 100644
index 0000000..76ca513
--- /dev/null
+++ b/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/code.php
@@ -0,0 +1,504 @@
+
+ * @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\Compiler\JoomlaPower;
+
+
+use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power\InjectorInterface;
+use VDM\Joomla\Componentbuilder\Compiler\Power\Injector;
+
+
+/**
+ * Compiler Joomla Power Injector
+ * @since 3.2.0
+ */
+final class Injector extends Injector implements InjectorInterface
+{
+	/**
+	 * Update the code
+	 *
+	 * @param array   $guids The Power guids found
+	 * @param string   $code The class code
+	 *
+	 * @return string   The updated code
+	 * @since 3.2.0
+	 */
+	protected function update(array $guids, string $code): string
+	{
+		$use_statements = $this->parser->getUseStatements($code);
+		$traits = $this->parser->getTraits(
+			$this->parser->getClassCode($code) ?? ''
+		);
+
+		// reset with each file
+		$this->map = [];
+		$this->useStatements = [];
+		$this->traits = [];
+		$this->other = [];
+		$this->duplicate = [];
+
+		foreach ($guids as $key => $guid)
+		{
+			if  (($power = $this->power->get($guid)) !== null)
+			{
+				if (($name = $this->inspect($power, $use_statements, $traits)) !== null)
+				{
+					$this->map[$key] = $name;
+				}
+			}
+		}
+
+		// update
+		if ($this->map !== [])
+		{
+			if ($this->useStatements !== [])
+			{
+				$code = $this->addUseStatements($code, $use_statements);
+			}
+
+			return $this->placeholder->update($code, $this->map);
+		}
+
+		return $code;
+	}
+
+	/**
+	 * Inspect the super power to determine the necessary class name based on use statements and traits.
+	 * It checks if the given power (class, trait, etc.) already has a corresponding use statement
+	 * and handles the naming accordingly to avoid conflicts.
+	 *
+	 * @param object      $power           The power object containing type, namespace, and class name.
+	 * @param array|null  $useStatements   Array of existing use statements in the code.
+	 * @param array|null  $traits          Array of existing traits used in the code.
+	 *
+	 * @return string|null The determined class name, or null if the type is not valid.
+	 * @since 3.2.0
+	 */
+	protected function inspect(object $power, ?array $useStatements, ?array $traits): ?string
+	{
+		$namespaceStatement = $this->buildNamespaceStatment($power);
+
+		$use_extracted = $this->extractUseStatements($namespaceStatement, $power->class_name, $useStatements);
+
+		$name = $use_extracted['found'] ?? $power->class_name;
+
+		$name = $this->getUniqueName($name, $power);
+
+		$this->handleTraitLogic($name, $power, $traits);
+
+		if (!$use_extracted['hasStatement'])
+		{
+			$this->addUseStatement($name, $power->class_name, $namespaceStatement);
+		}
+
+		return $name;
+	}
+
+	/**
+	 * Builds the namespace statement from the power object's namespace and class name.
+	 *
+	 * @param object $power  The power object.
+	 *
+	 * @return string The constructed use statement.
+	 * @since 3.2.0
+	 */
+	protected function buildNamespaceStatment(object $power): string
+	{
+		return $power->_namespace . '\\' . $power->class_name;
+	}
+
+	/**
+	 * Extracts and processes use statements to find if the current class name is already used.
+	 * It identifies any potential naming conflicts.
+	 *
+	 * @param string      $useStatement     The search statement of the current class.
+	 * @param string      $className         The class name of the power object.
+	 * @param array|null  $useStatements     The existing use statements.
+	 *
+	 * @return array  An array with keys 'found' and 'hasStatement'.
+	 * @since 3.2.0
+	 */
+	protected function extractUseStatements(string $useStatement, string $className, ?array $useStatements): array
+	{
+		$results = ['found' => null, 'hasStatement' => false];
+
+		if ($useStatements !== null)
+		{
+			foreach ($useStatements as $use_statement)
+			{
+				$class_name = $this->extractClassNameOrAlias($use_statement);
+
+				if ($this->isUseStatementEqual($use_statement, $useStatement))
+				{
+					if ($results['found'] === null)
+					{
+						$results['found'] = $class_name;
+						$results['hasStatement'] = true;
+					}
+					else
+					{
+						// TODO we need to backport fix these
+						$this->duplicate[$use_statement] = $class_name;
+					}
+				}
+				elseif ($className === $class_name)
+				{
+					$this->other[$className] = $class_name;
+				}
+			}
+		}
+
+		return $results;
+	}
+
+	/**
+	 * Checks if the namespace statement is already declared in the current use statements.
+	 *
+	 * This method uses a regular expression to check for an exact match of the full statement,
+	 * taking into account the possibility of an alias being used.
+	 *
+	 * @param string  $useStatement     The existing use statement to check against.
+	 * @param string  $namespaceStatement  The search statement to search for (without the trailing semicolon, or use prefix).
+	 *
+	 * @return bool True if the full statement is found, false otherwise.
+	 */
+	protected function isUseStatementEqual(string $useStatement, string $namespaceStatement): bool
+	{
+		// Create a regular expression pattern to match the full statement
+		// The pattern checks for the start of the statement, optional whitespace,
+		// and an optional alias after the full statement.
+		$pattern = '/^use\s+' . preg_quote($namespaceStatement, '/') . '(?:\s+as\s+\w+)?;$/';
+
+		// Perform the regex match to check if the use statement is equal to the search statment
+		return (bool) preg_match($pattern, $useStatement);
+	}
+
+	/**
+	 * Extracts the class name or alias from a use statement.
+	 *
+	 * This method parses a PHP 'use' statement and extracts either the class name or its alias.
+	 * If the statement doesn't match the expected format, or if no class name or alias is found,
+	 * the method returns null.
+	 *
+	 * Example: 
+	 * - 'use Namespace\ClassName;' -> returns 'ClassName'
+	 * - 'use Namespace\ClassName as Alias;' -> returns 'Alias'
+	 *
+	 * @param string  $useStatement  The use statement from which to extract the class name or alias.
+	 *
+	 * @return string|null The class name or alias if found, null otherwise.
+	 * @since 3.2.0
+	 */
+	protected function extractClassNameOrAlias(string $useStatement): ?string
+	{
+		// If the input doesn't start with 'use ', assume it's just the namespace without a use statement
+		if (strpos($useStatement, 'use ') !== 0)
+		{
+			return $this->extractLastNameFromNamespace($useStatement);
+		}
+
+		// Regular expression to extract the class name and alias from the use statement
+		$pattern = '/use\s+(?P[\w\\\\]+?)(?:\s+as\s+(?P\w+))?;/';
+
+		if (preg_match($pattern, $useStatement, $matches))
+		{
+			// Return the alias if it exists; otherwise, return the last part of the namespace (class name)
+			return $matches['alias'] ?? $this->extractLastNameFromNamespace($matches['namespace']);
+		}
+
+		// Return null if no match is found
+		return null;
+	}
+
+	/**
+	 * Ensures the name for the use statement is unique, avoiding conflicts with other classes.
+	 *
+	 * @param string  $name       The current name
+	 * @param object  $power      The power object containing type, namespace, and class name.
+	 *
+	 * @return string  The unique name
+	 * @since 3.2.0
+	 */
+	protected function getUniqueName(string $name, object $power): string
+	{
+		// set search namespace
+		$namespace = ($name !== $power->class_name) ? $this->buildNamespaceStatment($power) : $power->_namespace;
+
+		// check if we need to update the name
+		if (isset($this->other[$name]))
+		{
+			// if the name is already used
+			while (isset($this->other[$name]))
+			{
+				if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null)
+				{
+					$name = ucfirst($tmp) . $name;
+					$namespace = $this->removeLastNameFromNamespace($namespace);
+				}
+				else
+				{
+					$name = 'Unique' . $name;
+				}
+			}
+		}
+
+		// also loop new found use statements
+		if (isset($this->useStatements[$name]))
+		{
+			// if the name is already used
+			while (isset($this->useStatements[$name]))
+			{
+				if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null)
+				{
+					$name = ucfirst($tmp) . $name;
+					$namespace = $this->removeLastNameFromNamespace($namespace);
+				}
+				else
+				{
+					$name = 'Unique' . $name;
+				}
+			}
+		}
+
+		return $name;
+	}
+
+	/**
+	 * Extracts the last part of a namespace string, which is typically the class name.
+	 *
+	 * @param string $namespace  The namespace string to extract from.
+	 *
+	 * @return string|null The extracted class name.
+	 * @since 3.2.0
+	 */
+	protected function extractLastNameFromNamespace(string $namespace): ?string
+	{
+		$parts = explode('\\', $namespace);
+		$result = end($parts);
+
+		// Remove '\\' from the beginning and end of the resulting string
+		$result = trim($result, '\\');
+
+		// If the resulting string is empty, return null
+		return empty($result) ? null : $result;
+	}
+
+	/**
+	 * Removes the last name from the namespace.
+	 *
+	 * @param string $namespace The namespace
+	 *
+	 * @return string The namespace shortened
+	 * @since 3.2.0
+	 */
+	protected function removeLastNameFromNamespace(string $namespace): string
+	{
+		// Remove '\\' from the beginning and end of the resulting string
+		$namespace = trim($namespace, '\\');
+
+		$parts = explode('\\', $namespace);
+
+		// Remove the last part (the class name)
+		array_pop($parts);
+
+		// Reassemble the namespace without the class name
+		return implode('\\', $parts);
+	}
+
+	/**
+	 * Determines whether a trait statement should be added.
+	 *
+	 * @param object $power The power object.
+	 *
+	 * @return bool True if a trait statement should be added, false otherwise.
+	 * @since 3.2.0
+	 */
+	protected function shouldAddTraitStatement(object $power): bool
+	{
+		return $power->type === 'trait';
+	}
+
+	/**
+	 * Handles specific logic for traits, such as checking if the trait is already used.
+	 *
+	 * @param string      $name    The current name.
+	 * @param object      $power   The power object containing type, namespace, and class name.
+	 * @param array|null  $traits  The traits used in the code.
+	 *
+	 * @return void
+	 * @since 3.2.0
+	 */
+	protected function handleTraitLogic(string $name, object $power, ?array $traits): void
+	{
+		if ($this->shouldAddTraitStatement($power) && $traits !== null)
+		{
+			foreach ($traits as $trait)
+			{
+				if ($trait === $name)
+				{
+					return;
+				}
+			}
+		}
+
+		// add the trait
+		$this->traits[$name] = 'use ' . $name . ';';
+	}
+
+	/**
+	 * Adds a use statement to the class if it's not already present.
+	 *
+	 * @param string  $name                The name to use.
+	 * @param string  $className           The class name of the power object.
+	 * @param string  $namespaceStatement  The search statement to search for (without the trailing semicolon, or use prefix).
+	 *
+	 * @since 3.2.0
+	 */
+	protected function addUseStatement(string &$name, string $className, string $namespaceStatement): void
+	{
+		if ($name !== $className)
+		{
+			$statement = 'use ' . $namespaceStatement . ' as ' . $name . ';';
+		}
+		else
+		{
+			$statement = 'use ' . $namespaceStatement . ';';
+		}
+
+		$this->useStatements[$name] = $statement;
+	}
+
+	/**
+	 * Insert a line before the class declaration in the given class code.
+	 *
+	 * @param string       $code             The class code
+	 * @param array|null   $useStatements    The existing use statements
+	 *
+	 * @return string The modified file content
+	 * @since 3.2.0
+	 */
+	protected function addUseStatements(string $code, ?array $useStatements): string
+	{
+		if ($useStatements !== null)
+		{
+			// we add the use statements using existing use statements
+			$key = end($useStatements);
+
+			array_unshift($this->useStatements, $key);
+
+			return $this->placeholder->update($code, [$key => implode(PHP_EOL, array_values($this->useStatements))]);
+		}
+
+		return $this->addLines($code, implode(PHP_EOL, array_values($this->useStatements)));
+	}
+
+	/**
+	 * Insert a line before the class declaration in the given class code.
+	 *
+	 * @param string   $code     The class code
+	 * @param string   $lines    The new lines to insert
+	 *
+	 * @return string The modified file content
+	 * @since 3.2.0
+	 */
+	protected function addLines(string $code, string $lines): string
+	{
+		// Pattern to match class, final class, abstract class, interface, and trait
+		$pattern = '/(?:class|final class|abstract class|interface|trait)\s+[a-zA-Z0-9_]+\s*(?:extends\s+[a-zA-Z0-9_]+\s*)?(?:implements\s+[a-zA-Z0-9_]+(?:\s*,\s*[a-zA-Z0-9_]+)*)?\s*\{/s';
+
+		// Find the position of the class declaration
+		preg_match($pattern, $code, $matches, PREG_OFFSET_CAPTURE);
+		$class_declaration_pos = $matches[0][1] ?? null;
+
+		if (null !== $class_declaration_pos)
+		{
+			// Find the position of the last newline character before the class declaration
+			$last_newline_pos = strrpos($code, PHP_EOL, -(strlen($code) - $class_declaration_pos));
+
+			// Find the position of the comment block right before the class declaration
+			$comment_pattern = '/\s*\*\/\s*$/m';
+			$insert_pos = null;
+			if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, $last_newline_pos))
+			{
+				$insert_pos = (int) $comment_matches[0][1] + strlen($comment_matches[0][0]);
+			}
+			else
+			{
+				// Find the last empty line before the class declaration
+				$empty_line_pattern = '/(^|\r\n|\r|\n)[\s]*($|\r\n|\r|\n)/';
+				if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, $last_newline_pos))
+				{
+					$insert_pos = (int) $empty_line_matches[0][1] + strlen($empty_line_matches[0][0]);
+				}
+			}
+
+			// Insert the new line at the found position
+			if (null !== $insert_pos)
+			{
+				return substr_replace($code, $lines . PHP_EOL, $insert_pos, 0);
+			}
+		}
+
+		// last try targeting the defined line
+		return $this->addLinesAfterDefinedLine($code, $lines);
+	}
+
+	/**
+	 * Inserts a new line after the defined('_JEXEC') line.
+	 *
+	 * @param string   $code     The class code
+	 * @param string   $lines    The new lines to insert
+	 *
+	 * @return string The modified file content
+	 * @since 3.2.0
+	 */
+	protected function addLinesAfterDefinedLine(string $code, string $lines): string
+	{
+		// Patterns to match the defined('_JEXEC') and defined('JPATH_BASE') lines
+		$patterns = [
+			"/defined\('_JEXEC'\)(.*?)\s*;/",
+			"/\\defined\('_JEXEC'\)(.*?)\s*;/",
+			"/defined\('JPATH_BASE'\)(.*?)\s*;/",
+			"/\\defined\('JPATH_BASE'\)(.*?)\s*;/",
+		];
+
+		$insert_pos = null;
+
+		// Iterate through the patterns and try to find a match
+		foreach ($patterns as $pattern)
+		{
+			preg_match($pattern, $code, $matches, PREG_OFFSET_CAPTURE);
+			$defined_line_pos = $matches[0][1] ?? null;
+
+			if ($defined_line_pos !== null)
+			{
+				// Find the position of the newline character after the defined() line
+				$next_lines_pos = strpos($code, PHP_EOL, (int) $defined_line_pos + strlen($matches[0][0]));
+
+				// Insert the new line at the found position
+				if ($next_lines_pos !== false)
+				{
+					$insert_pos = $next_lines_pos;
+					break;
+				}
+			}
+		}
+
+		// Insert the new line at the found position
+		if ($insert_pos !== null)
+		{
+			$code = substr_replace($code, PHP_EOL . $lines, $insert_pos, 0);
+		}
+
+		return $code;
+	}
+}
+
diff --git a/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/code.power b/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/code.power
new file mode 100644
index 0000000..04b1b6d
--- /dev/null
+++ b/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/code.power
@@ -0,0 +1,478 @@
+	/**
+	 * Update the code
+	 *
+	 * @param array   $guids The Power guids found
+	 * @param string   $code The class code
+	 *
+	 * @return string   The updated code
+	 * @since 3.2.0
+	 */
+	protected function update(array $guids, string $code): string
+	{
+		$use_statements = $this->parser->getUseStatements($code);
+		$traits = $this->parser->getTraits(
+			$this->parser->getClassCode($code) ?? ''
+		);
+
+		// reset with each file
+		$this->map = [];
+		$this->useStatements = [];
+		$this->traits = [];
+		$this->other = [];
+		$this->duplicate = [];
+
+		foreach ($guids as $key => $guid)
+		{
+			if  (($power = $this->power->get($guid)) !== null)
+			{
+				if (($name = $this->inspect($power, $use_statements, $traits)) !== null)
+				{
+					$this->map[$key] = $name;
+				}
+			}
+		}
+
+		// update
+		if ($this->map !== [])
+		{
+			if ($this->useStatements !== [])
+			{
+				$code = $this->addUseStatements($code, $use_statements);
+			}
+
+			return $this->placeholder->update($code, $this->map);
+		}
+
+		return $code;
+	}
+
+	/**
+	 * Inspect the super power to determine the necessary class name based on use statements and traits.
+	 * It checks if the given power (class, trait, etc.) already has a corresponding use statement
+	 * and handles the naming accordingly to avoid conflicts.
+	 *
+	 * @param object      $power           The power object containing type, namespace, and class name.
+	 * @param array|null  $useStatements   Array of existing use statements in the code.
+	 * @param array|null  $traits          Array of existing traits used in the code.
+	 *
+	 * @return string|null The determined class name, or null if the type is not valid.
+	 * @since 3.2.0
+	 */
+	protected function inspect(object $power, ?array $useStatements, ?array $traits): ?string
+	{
+		$namespaceStatement = $this->buildNamespaceStatment($power);
+
+		$use_extracted = $this->extractUseStatements($namespaceStatement, $power->class_name, $useStatements);
+
+		$name = $use_extracted['found'] ?? $power->class_name;
+
+		$name = $this->getUniqueName($name, $power);
+
+		$this->handleTraitLogic($name, $power, $traits);
+
+		if (!$use_extracted['hasStatement'])
+		{
+			$this->addUseStatement($name, $power->class_name, $namespaceStatement);
+		}
+
+		return $name;
+	}
+
+	/**
+	 * Builds the namespace statement from the power object's namespace and class name.
+	 *
+	 * @param object $power  The power object.
+	 *
+	 * @return string The constructed use statement.
+	 * @since 3.2.0
+	 */
+	protected function buildNamespaceStatment(object $power): string
+	{
+		return $power->_namespace . '\\' . $power->class_name;
+	}
+
+	/**
+	 * Extracts and processes use statements to find if the current class name is already used.
+	 * It identifies any potential naming conflicts.
+	 *
+	 * @param string      $useStatement     The search statement of the current class.
+	 * @param string      $className         The class name of the power object.
+	 * @param array|null  $useStatements     The existing use statements.
+	 *
+	 * @return array  An array with keys 'found' and 'hasStatement'.
+	 * @since 3.2.0
+	 */
+	protected function extractUseStatements(string $useStatement, string $className, ?array $useStatements): array
+	{
+		$results = ['found' => null, 'hasStatement' => false];
+
+		if ($useStatements !== null)
+		{
+			foreach ($useStatements as $use_statement)
+			{
+				$class_name = $this->extractClassNameOrAlias($use_statement);
+
+				if ($this->isUseStatementEqual($use_statement, $useStatement))
+				{
+					if ($results['found'] === null)
+					{
+						$results['found'] = $class_name;
+						$results['hasStatement'] = true;
+					}
+					else
+					{
+						// TODO we need to backport fix these
+						$this->duplicate[$use_statement] = $class_name;
+					}
+				}
+				elseif ($className === $class_name)
+				{
+					$this->other[$className] = $class_name;
+				}
+			}
+		}
+
+		return $results;
+	}
+
+	/**
+	 * Checks if the namespace statement is already declared in the current use statements.
+	 *
+	 * This method uses a regular expression to check for an exact match of the full statement,
+	 * taking into account the possibility of an alias being used.
+	 *
+	 * @param string  $useStatement     The existing use statement to check against.
+	 * @param string  $namespaceStatement  The search statement to search for (without the trailing semicolon, or use prefix).
+	 *
+	 * @return bool True if the full statement is found, false otherwise.
+	 */
+	protected function isUseStatementEqual(string $useStatement, string $namespaceStatement): bool
+	{
+		// Create a regular expression pattern to match the full statement
+		// The pattern checks for the start of the statement, optional whitespace,
+		// and an optional alias after the full statement.
+		$pattern = '/^use\s+' . preg_quote($namespaceStatement, '/') . '(?:\s+as\s+\w+)?;$/';
+
+		// Perform the regex match to check if the use statement is equal to the search statment
+		return (bool) preg_match($pattern, $useStatement);
+	}
+
+	/**
+	 * Extracts the class name or alias from a use statement.
+	 *
+	 * This method parses a PHP 'use' statement and extracts either the class name or its alias.
+	 * If the statement doesn't match the expected format, or if no class name or alias is found,
+	 * the method returns null.
+	 *
+	 * Example: 
+	 * - 'use Namespace\ClassName;' -> returns 'ClassName'
+	 * - 'use Namespace\ClassName as Alias;' -> returns 'Alias'
+	 *
+	 * @param string  $useStatement  The use statement from which to extract the class name or alias.
+	 *
+	 * @return string|null The class name or alias if found, null otherwise.
+	 * @since 3.2.0
+	 */
+	protected function extractClassNameOrAlias(string $useStatement): ?string
+	{
+		// If the input doesn't start with 'use ', assume it's just the namespace without a use statement
+		if (strpos($useStatement, 'use ') !== 0)
+		{
+			return $this->extractLastNameFromNamespace($useStatement);
+		}
+
+		// Regular expression to extract the class name and alias from the use statement
+		$pattern = '/use\s+(?P[\w\\\\]+?)(?:\s+as\s+(?P\w+))?;/';
+
+		if (preg_match($pattern, $useStatement, $matches))
+		{
+			// Return the alias if it exists; otherwise, return the last part of the namespace (class name)
+			return $matches['alias'] ?? $this->extractLastNameFromNamespace($matches['namespace']);
+		}
+
+		// Return null if no match is found
+		return null;
+	}
+
+	/**
+	 * Ensures the name for the use statement is unique, avoiding conflicts with other classes.
+	 *
+	 * @param string  $name       The current name
+	 * @param object  $power      The power object containing type, namespace, and class name.
+	 *
+	 * @return string  The unique name
+	 * @since 3.2.0
+	 */
+	protected function getUniqueName(string $name, object $power): string
+	{
+		// set search namespace
+		$namespace = ($name !== $power->class_name) ? $this->buildNamespaceStatment($power) : $power->_namespace;
+
+		// check if we need to update the name
+		if (isset($this->other[$name]))
+		{
+			// if the name is already used
+			while (isset($this->other[$name]))
+			{
+				if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null)
+				{
+					$name = ucfirst($tmp) . $name;
+					$namespace = $this->removeLastNameFromNamespace($namespace);
+				}
+				else
+				{
+					$name = 'Unique' . $name;
+				}
+			}
+		}
+
+		// also loop new found use statements
+		if (isset($this->useStatements[$name]))
+		{
+			// if the name is already used
+			while (isset($this->useStatements[$name]))
+			{
+				if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null)
+				{
+					$name = ucfirst($tmp) . $name;
+					$namespace = $this->removeLastNameFromNamespace($namespace);
+				}
+				else
+				{
+					$name = 'Unique' . $name;
+				}
+			}
+		}
+
+		return $name;
+	}
+
+	/**
+	 * Extracts the last part of a namespace string, which is typically the class name.
+	 *
+	 * @param string $namespace  The namespace string to extract from.
+	 *
+	 * @return string|null The extracted class name.
+	 * @since 3.2.0
+	 */
+	protected function extractLastNameFromNamespace(string $namespace): ?string
+	{
+		$parts = explode('\\', $namespace);
+		$result = end($parts);
+
+		// Remove '\\' from the beginning and end of the resulting string
+		$result = trim($result, '\\');
+
+		// If the resulting string is empty, return null
+		return empty($result) ? null : $result;
+	}
+
+	/**
+	 * Removes the last name from the namespace.
+	 *
+	 * @param string $namespace The namespace
+	 *
+	 * @return string The namespace shortened
+	 * @since 3.2.0
+	 */
+	protected function removeLastNameFromNamespace(string $namespace): string
+	{
+		// Remove '\\' from the beginning and end of the resulting string
+		$namespace = trim($namespace, '\\');
+
+		$parts = explode('\\', $namespace);
+
+		// Remove the last part (the class name)
+		array_pop($parts);
+
+		// Reassemble the namespace without the class name
+		return implode('\\', $parts);
+	}
+
+	/**
+	 * Determines whether a trait statement should be added.
+	 *
+	 * @param object $power The power object.
+	 *
+	 * @return bool True if a trait statement should be added, false otherwise.
+	 * @since 3.2.0
+	 */
+	protected function shouldAddTraitStatement(object $power): bool
+	{
+		return $power->type === 'trait';
+	}
+
+	/**
+	 * Handles specific logic for traits, such as checking if the trait is already used.
+	 *
+	 * @param string      $name    The current name.
+	 * @param object      $power   The power object containing type, namespace, and class name.
+	 * @param array|null  $traits  The traits used in the code.
+	 *
+	 * @return void
+	 * @since 3.2.0
+	 */
+	protected function handleTraitLogic(string $name, object $power, ?array $traits): void
+	{
+		if ($this->shouldAddTraitStatement($power) && $traits !== null)
+		{
+			foreach ($traits as $trait)
+			{
+				if ($trait === $name)
+				{
+					return;
+				}
+			}
+		}
+
+		// add the trait
+		$this->traits[$name] = 'use ' . $name . ';';
+	}
+
+	/**
+	 * Adds a use statement to the class if it's not already present.
+	 *
+	 * @param string  $name                The name to use.
+	 * @param string  $className           The class name of the power object.
+	 * @param string  $namespaceStatement  The search statement to search for (without the trailing semicolon, or use prefix).
+	 *
+	 * @since 3.2.0
+	 */
+	protected function addUseStatement(string &$name, string $className, string $namespaceStatement): void
+	{
+		if ($name !== $className)
+		{
+			$statement = 'use ' . $namespaceStatement . ' as ' . $name . ';';
+		}
+		else
+		{
+			$statement = 'use ' . $namespaceStatement . ';';
+		}
+
+		$this->useStatements[$name] = $statement;
+	}
+
+	/**
+	 * Insert a line before the class declaration in the given class code.
+	 *
+	 * @param string       $code             The class code
+	 * @param array|null   $useStatements    The existing use statements
+	 *
+	 * @return string The modified file content
+	 * @since 3.2.0
+	 */
+	protected function addUseStatements(string $code, ?array $useStatements): string
+	{
+		if ($useStatements !== null)
+		{
+			// we add the use statements using existing use statements
+			$key = end($useStatements);
+
+			array_unshift($this->useStatements, $key);
+
+			return $this->placeholder->update($code, [$key => implode(PHP_EOL, array_values($this->useStatements))]);
+		}
+
+		return $this->addLines($code, implode(PHP_EOL, array_values($this->useStatements)));
+	}
+
+	/**
+	 * Insert a line before the class declaration in the given class code.
+	 *
+	 * @param string   $code     The class code
+	 * @param string   $lines    The new lines to insert
+	 *
+	 * @return string The modified file content
+	 * @since 3.2.0
+	 */
+	protected function addLines(string $code, string $lines): string
+	{
+		// Pattern to match class, final class, abstract class, interface, and trait
+		$pattern = '/(?:class|final class|abstract class|interface|trait)\s+[a-zA-Z0-9_]+\s*(?:extends\s+[a-zA-Z0-9_]+\s*)?(?:implements\s+[a-zA-Z0-9_]+(?:\s*,\s*[a-zA-Z0-9_]+)*)?\s*\{/s';
+
+		// Find the position of the class declaration
+		preg_match($pattern, $code, $matches, PREG_OFFSET_CAPTURE);
+		$class_declaration_pos = $matches[0][1] ?? null;
+
+		if (null !== $class_declaration_pos)
+		{
+			// Find the position of the last newline character before the class declaration
+			$last_newline_pos = strrpos($code, PHP_EOL, -(strlen($code) - $class_declaration_pos));
+
+			// Find the position of the comment block right before the class declaration
+			$comment_pattern = '/\s*\*\/\s*$/m';
+			$insert_pos = null;
+			if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, $last_newline_pos))
+			{
+				$insert_pos = (int) $comment_matches[0][1] + strlen($comment_matches[0][0]);
+			}
+			else
+			{
+				// Find the last empty line before the class declaration
+				$empty_line_pattern = '/(^|\r\n|\r|\n)[\s]*($|\r\n|\r|\n)/';
+				if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, $last_newline_pos))
+				{
+					$insert_pos = (int) $empty_line_matches[0][1] + strlen($empty_line_matches[0][0]);
+				}
+			}
+
+			// Insert the new line at the found position
+			if (null !== $insert_pos)
+			{
+				return substr_replace($code, $lines . PHP_EOL, $insert_pos, 0);
+			}
+		}
+
+		// last try targeting the defined line
+		return $this->addLinesAfterDefinedLine($code, $lines);
+	}
+
+	/**
+	 * Inserts a new line after the defined('_JEXEC') line.
+	 *
+	 * @param string   $code     The class code
+	 * @param string   $lines    The new lines to insert
+	 *
+	 * @return string The modified file content
+	 * @since 3.2.0
+	 */
+	protected function addLinesAfterDefinedLine(string $code, string $lines): string
+	{
+		// Patterns to match the defined('_JEXEC') and defined('JPATH_BASE') lines
+		$patterns = [
+			"/defined\('_JEXEC'\)(.*?)\s*;/",
+			"/\\defined\('_JEXEC'\)(.*?)\s*;/",
+			"/defined\('JPATH_BASE'\)(.*?)\s*;/",
+			"/\\defined\('JPATH_BASE'\)(.*?)\s*;/",
+		];
+
+		$insert_pos = null;
+
+		// Iterate through the patterns and try to find a match
+		foreach ($patterns as $pattern)
+		{
+			preg_match($pattern, $code, $matches, PREG_OFFSET_CAPTURE);
+			$defined_line_pos = $matches[0][1] ?? null;
+
+			if ($defined_line_pos !== null)
+			{
+				// Find the position of the newline character after the defined() line
+				$next_lines_pos = strpos($code, PHP_EOL, (int) $defined_line_pos + strlen($matches[0][0]));
+
+				// Insert the new line at the found position
+				if ($next_lines_pos !== false)
+				{
+					$insert_pos = $next_lines_pos;
+					break;
+				}
+			}
+		}
+
+		// Insert the new line at the found position
+		if ($insert_pos !== null)
+		{
+			$code = substr_replace($code, PHP_EOL . $lines, $insert_pos, 0);
+		}
+
+		return $code;
+	}
\ No newline at end of file
diff --git a/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/settings.json b/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/settings.json
new file mode 100644
index 0000000..d1a5775
--- /dev/null
+++ b/src/a6052fe9-0d2b-4b36-b3e7-03b47c483542/settings.json
@@ -0,0 +1,20 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "763d137c-42bc-4282-98d8-cc5c0654985f",
+    "guid": "a6052fe9-0d2b-4b36-b3e7-03b47c483542",
+    "implements": [
+        "e923311a-4058-4e81-9f67-5956fd0c627c"
+    ],
+    "load_selection": null,
+    "name": "Injector",
+    "power_version": "1.0.0",
+    "system_name": "JCB.Compiler.JoomlaPower.Injector",
+    "type": "final class",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.JoomlaPower.Injector",
+    "description": "Compiler Joomla Power Injector\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/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/README.md b/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/README.md
new file mode 100644
index 0000000..08308c7
--- /dev/null
+++ b/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/README.md
@@ -0,0 +1,31 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# final class Load (Details)
+> namespace: **VDM\Joomla\Componentbuilder\JoomlaPower\Database**
+> extends: **Load**
+```uml
+@startuml
+class Load << (F,LightGreen) >> #RoyalBlue {
+  # string $table
+}
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/code.php b/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/code.php
new file mode 100644
index 0000000..ce786e2
--- /dev/null
+++ b/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/code.php
@@ -0,0 +1,34 @@
+
+ * @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\JoomlaPower\Database;
+
+
+use VDM\Joomla\Componentbuilder\Power\Database\LoadInterface;
+use VDM\Joomla\Componentbuilder\Power\Database\Load;
+
+
+/**
+ * Power Database Load
+ * 
+ * @since 2.0.1
+ */
+final class Load extends Load implements LoadInterface
+{
+	/**
+	 * Table Name
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 */
+	protected string $table = 'joomla_power';
+}
+
diff --git a/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/code.power b/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/code.power
new file mode 100644
index 0000000..1d2fc75
--- /dev/null
+++ b/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/code.power
@@ -0,0 +1,7 @@
+	/**
+	 * Table Name
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 */
+	protected string $table = 'joomla_power';
\ No newline at end of file
diff --git a/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/settings.json b/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/settings.json
new file mode 100644
index 0000000..cc4b3ce
--- /dev/null
+++ b/src/b4ea5de3-653f-43f9-b927-4ba6456b4d0a/settings.json
@@ -0,0 +1,20 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "1f86db0f-e271-45df-8795-3e503ec76698",
+    "guid": "b4ea5de3-653f-43f9-b927-4ba6456b4d0a",
+    "implements": [
+        "99786f53-64b7-4d52-95b0-5306e7386c3f"
+    ],
+    "load_selection": null,
+    "name": "Load",
+    "power_version": "1.0.0",
+    "system_name": "JCB.JoomlaPower.Database.Load",
+    "type": "final class",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.JoomlaPower.Database.Load",
+    "description": "Power Database Load\r\n\r\n@since 2.0.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": ""
+}
\ No newline at end of file
diff --git a/src/bb29a833-73f7-4283-9327-bc7e41f0723b/README.md b/src/bb29a833-73f7-4283-9327-bc7e41f0723b/README.md
index 14009c0..6314f70 100644
--- a/src/bb29a833-73f7-4283-9327-bc7e41f0723b/README.md
+++ b/src/bb29a833-73f7-4283-9327-bc7e41f0723b/README.md
@@ -6,12 +6,12 @@
 ██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
 ╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
 ```
-# final class Load (Details)
+# class Load (Details)
 > namespace: **VDM\Joomla\Componentbuilder\Power\Model**
 > extends: **AbstractionModel**
 ```uml
 @startuml
-class Load << (F,LightGreen) >> #RoyalBlue {
+class Load  #Gold {
   + value(mixed $value, string $field, ...) : mixed
   # validateBefore(mixed $value, ?string $field = null, ...) : bool
   # validateAfter(mixed $value, ?string $field = null, ...) : bool
diff --git a/src/bb29a833-73f7-4283-9327-bc7e41f0723b/code.php b/src/bb29a833-73f7-4283-9327-bc7e41f0723b/code.php
index 0463790..6254608 100644
--- a/src/bb29a833-73f7-4283-9327-bc7e41f0723b/code.php
+++ b/src/bb29a833-73f7-4283-9327-bc7e41f0723b/code.php
@@ -24,7 +24,7 @@ use VDM\Joomla\Interfaces\ModelInterface;
  * 
  * @since 3.2.0
  */
-final class Load extends AbstractionModel implements ModelInterface
+class Load extends AbstractionModel implements ModelInterface
 {
 	/**
 	 * Model the value
diff --git a/src/bb29a833-73f7-4283-9327-bc7e41f0723b/settings.json b/src/bb29a833-73f7-4283-9327-bc7e41f0723b/settings.json
index 583eac9..e2a9213 100644
--- a/src/bb29a833-73f7-4283-9327-bc7e41f0723b/settings.json
+++ b/src/bb29a833-73f7-4283-9327-bc7e41f0723b/settings.json
@@ -10,7 +10,7 @@
     "name": "Load",
     "power_version": "1.0.0",
     "system_name": "JCB.Power.Model.Load",
-    "type": "final class",
+    "type": "class",
     "use_selection": {
         "use_selection0": {
             "use": "584747d1-3a86-453d-b7a3-a2219de8d777",
diff --git a/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/README.md b/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/README.md
new file mode 100644
index 0000000..7bafa91
--- /dev/null
+++ b/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/README.md
@@ -0,0 +1,61 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# interface ExtractorInterface (Details)
+> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power**
+```uml
+@startuml
+interface ExtractorInterface  #Lavender {
+  + get_() : ?array
+  + get(string $code) : ?array
+  + reverse(string $code) : ?array
+  + search(string $code) : void
+}
+
+note right of ExtractorInterface::get_
+  Get Super Powers from the code string
+
+  since: 3.2.0
+  return: ?array
+end note
+
+note right of ExtractorInterface::get
+  Get Super Powers from the code string
+
+  since: 3.2.0
+  return: ?array
+end note
+
+note right of ExtractorInterface::reverse
+  Get Super Powers from the code string
+
+  since: 3.2.0
+  return: ?array
+end note
+
+note right of ExtractorInterface::search
+  Get Super Powers from the code string and load it
+
+  since: 3.2.0
+  return: void
+end note
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/code.php b/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/code.php
new file mode 100644
index 0000000..18fe5cb
--- /dev/null
+++ b/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/code.php
@@ -0,0 +1,61 @@
+
+ * @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\Compiler\Interfaces\Power;
+
+
+/**
+ * Compiler Power Extractor
+ * @since 3.2.1
+ */
+interface ExtractorInterface
+{
+	/**
+	 * Get Super Powers from the code string
+	 *
+	 * @param string    $code The code
+	 *
+	 * @return array|null
+	 * @since 3.2.0
+	 */
+	public function get_(): ?array;
+
+	/**
+	 * Get Super Powers from the code string
+	 *
+	 * @param string    $code The code
+	 *
+	 * @return array|null
+	 * @since 3.2.0
+	 */
+	public function get(string $code): ?array;
+
+	/**
+	 * Get Super Powers from the code string
+	 *
+	 * @param string    $code The code
+	 *
+	 * @return array|null
+	 * @since 3.2.0
+	 */
+	public function reverse(string $code): ?array;
+
+	/**
+	 * Get Super Powers from the code string and load it
+	 *
+	 * @param string    $code The code
+	 *
+	 * @return void
+	 * @since 3.2.0
+	 */
+	public function search(string $code): void;
+}
+
diff --git a/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/code.power b/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/code.power
new file mode 100644
index 0000000..53d23e0
--- /dev/null
+++ b/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/code.power
@@ -0,0 +1,39 @@
+	/**
+	 * Get Super Powers from the code string
+	 *
+	 * @param string    $code The code
+	 *
+	 * @return array|null
+	 * @since 3.2.0
+	 */
+	public function get_(): ?array;
+
+	/**
+	 * Get Super Powers from the code string
+	 *
+	 * @param string    $code The code
+	 *
+	 * @return array|null
+	 * @since 3.2.0
+	 */
+	public function get(string $code): ?array;
+
+	/**
+	 * Get Super Powers from the code string
+	 *
+	 * @param string    $code The code
+	 *
+	 * @return array|null
+	 * @since 3.2.0
+	 */
+	public function reverse(string $code): ?array;
+
+	/**
+	 * Get Super Powers from the code string and load it
+	 *
+	 * @param string    $code The code
+	 *
+	 * @return void
+	 * @since 3.2.0
+	 */
+	public function search(string $code): void;
\ No newline at end of file
diff --git a/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/settings.json b/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/settings.json
new file mode 100644
index 0000000..e0129bb
--- /dev/null
+++ b/src/c159425c-51f9-4a15-af99-f2d0c6d7aae8/settings.json
@@ -0,0 +1,18 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "0",
+    "guid": "c159425c-51f9-4a15-af99-f2d0c6d7aae8",
+    "implements": null,
+    "load_selection": null,
+    "name": "ExtractorInterface",
+    "power_version": "1.0.0",
+    "system_name": "JCB.Compiler.Interfaces.Power.ExtractorInterface",
+    "type": "interface",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Power.ExtractorInterface",
+    "description": "Compiler Power Extractor\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": ""
+}
\ No newline at end of file
diff --git a/src/c182506a-ab84-439c-b962-1e606b58d545/README.md b/src/c182506a-ab84-439c-b962-1e606b58d545/README.md
new file mode 100644
index 0000000..441b4ad
--- /dev/null
+++ b/src/c182506a-ab84-439c-b962-1e606b58d545/README.md
@@ -0,0 +1,45 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# interface GrepInterface (Details)
+> namespace: **VDM\Joomla\Componentbuilder\Interfaces**
+```uml
+@startuml
+interface GrepInterface  #Lavender {
+  + getRemotePowersGuid() : ?array
+  + get(string $guid, array $order = ['local', 'remote']) : ?object
+}
+
+note right of GrepInterface::getRemotePowersGuid
+  Get all remote powers GUID's
+
+  since: 3.2.0
+  return: ?array
+end note
+
+note right of GrepInterface::get
+  Get a power
+
+  since: 3.2.0
+  return: ?object
+end note
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/c182506a-ab84-439c-b962-1e606b58d545/code.php b/src/c182506a-ab84-439c-b962-1e606b58d545/code.php
new file mode 100644
index 0000000..a321919
--- /dev/null
+++ b/src/c182506a-ab84-439c-b962-1e606b58d545/code.php
@@ -0,0 +1,41 @@
+
+ * @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;
+
+
+/**
+ * Global Resource Empowerment Platform
+ * 
+ * @since 3.2.1
+ */
+interface GrepInterface
+{
+	/**
+	 * Get all remote powers GUID's
+	 *
+	 * @return array|null
+	 * @since 3.2.0
+	 */
+	public function getRemotePowersGuid(): ?array;
+
+	/**
+	 * Get a power
+	 *
+	 * @param string   $guid    The global unique id of the power
+	 * @param array    $order   The search order
+	 *
+	 * @return object|null
+	 * @since 3.2.0
+	 */
+	public function get(string $guid, array $order = ['local', 'remote']): ?object;
+}
+
diff --git a/src/c182506a-ab84-439c-b962-1e606b58d545/code.power b/src/c182506a-ab84-439c-b962-1e606b58d545/code.power
new file mode 100644
index 0000000..9d0b4aa
--- /dev/null
+++ b/src/c182506a-ab84-439c-b962-1e606b58d545/code.power
@@ -0,0 +1,18 @@
+	/**
+	 * Get all remote powers GUID's
+	 *
+	 * @return array|null
+	 * @since 3.2.0
+	 */
+	public function getRemotePowersGuid(): ?array;
+
+	/**
+	 * Get a power
+	 *
+	 * @param string   $guid    The global unique id of the power
+	 * @param array    $order   The search order
+	 *
+	 * @return object|null
+	 * @since 3.2.0
+	 */
+	public function get(string $guid, array $order = ['local', 'remote']): ?object;
\ No newline at end of file
diff --git a/src/c182506a-ab84-439c-b962-1e606b58d545/settings.json b/src/c182506a-ab84-439c-b962-1e606b58d545/settings.json
new file mode 100644
index 0000000..f53d0ff
--- /dev/null
+++ b/src/c182506a-ab84-439c-b962-1e606b58d545/settings.json
@@ -0,0 +1,18 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "0",
+    "guid": "c182506a-ab84-439c-b962-1e606b58d545",
+    "implements": null,
+    "load_selection": null,
+    "name": "GrepInterface",
+    "power_version": "1.0.0",
+    "system_name": "JCB.Interfaces.GrepInterface",
+    "type": "interface",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.Interfaces.GrepInterface",
+    "description": "Global Resource Empowerment Platform\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": ""
+}
\ No newline at end of file
diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php
index 990d0ea..9e74355 100644
--- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php
+++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.php
@@ -25,6 +25,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Service\Language;
 use VDM\Joomla\Componentbuilder\Compiler\Service\Placeholder;
 use VDM\Joomla\Componentbuilder\Compiler\Service\Customcode;
 use VDM\Joomla\Componentbuilder\Compiler\Service\Power;
+use VDM\Joomla\Componentbuilder\Compiler\Service\JoomlaPower;
 use VDM\Joomla\Componentbuilder\Compiler\Service\Component;
 use VDM\Joomla\Componentbuilder\Compiler\Service\Adminview;
 use VDM\Joomla\Componentbuilder\Compiler\Service\Library;
@@ -157,6 +158,7 @@ abstract class Factory implements FactoryInterface
 			->registerServiceProvider(new Placeholder())
 			->registerServiceProvider(new Customcode())
 			->registerServiceProvider(new Power())
+			->registerServiceProvider(new JoomlaPower())
 			->registerServiceProvider(new Component())
 			->registerServiceProvider(new Adminview())
 			->registerServiceProvider(new Library())
diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power
index 6df63c0..879e31c 100644
--- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power
+++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/code.power
@@ -93,6 +93,7 @@
 			->registerServiceProvider(new Placeholder())
 			->registerServiceProvider(new Customcode())
 			->registerServiceProvider(new Power())
+			->registerServiceProvider(new JoomlaPower())
 			->registerServiceProvider(new Component())
 			->registerServiceProvider(new Adminview())
 			->registerServiceProvider(new Library())
diff --git a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json
index ea305b8..327aa18 100644
--- a/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json
+++ b/src/d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac/settings.json
@@ -60,6 +60,10 @@
             "use": "de01527a-6586-46ea-92e7-11ea3de1cedb",
             "as": "default"
         },
+        "use_selection39": {
+            "use": "5716c79f-a1c9-4059-9d00-8cccb9f9e061",
+            "as": "default"
+        },
         "use_selection12": {
             "use": "8a63e87b-b39b-4a15-8044-9b2a2f4fb61c",
             "as": "default"
@@ -84,87 +88,87 @@
             "use": "ed9591cb-0a03-400a-bf47-eaf78ab19b9d",
             "as": "default"
         },
-        "use_selection38": {
+        "use_selection18": {
             "use": "f65b52c2-593a-4c35-89d1-4a8e57a1adf0",
             "as": "default"
         },
-        "use_selection18": {
+        "use_selection19": {
             "use": "c6c30d66-3106-44eb-9272-b2cf7ec74613",
             "as": "default"
         },
-        "use_selection19": {
+        "use_selection20": {
             "use": "295186de-5954-4a65-a4c1-2f79ef305743",
             "as": "default"
         },
-        "use_selection20": {
+        "use_selection21": {
             "use": "9eba241c-af90-42dd-ae05-92ff4d8391d3",
             "as": "default"
         },
-        "use_selection21": {
+        "use_selection22": {
             "use": "516f93b8-5fff-41c6-aeaf-2d93180a12cc",
             "as": "default"
         },
-        "use_selection22": {
+        "use_selection23": {
             "use": "c7230c8c-ea88-4d8d-8c53-6136133195b7",
             "as": "default"
         },
-        "use_selection23": {
+        "use_selection24": {
             "use": "2c76c06e-a371-4b73-9fbe-b4d9b4df55d7",
             "as": "default"
         },
-        "use_selection24": {
+        "use_selection25": {
             "use": "8fdd604f-53e7-4a91-9935-afcfd2f6ac1b",
             "as": "default"
         },
-        "use_selection25": {
+        "use_selection26": {
             "use": "56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60",
             "as": "default"
         },
-        "use_selection26": {
+        "use_selection27": {
             "use": "bbd36fbf-d905-47e8-8e67-9ea6ec734712",
             "as": "default"
         },
-        "use_selection27": {
+        "use_selection28": {
             "use": "71acf8d6-32b8-4173-8277-eb9cda29fd64",
             "as": "default"
         },
-        "use_selection28": {
+        "use_selection29": {
             "use": "6edf0cf3-c2b0-45c9-84d2-c6ef1c5d434c",
             "as": "GiteaUtilities"
         },
-        "use_selection29": {
+        "use_selection30": {
             "use": "f4d00907-c94a-49b7-8727-d64c1fa74cf5",
             "as": "GiteaSettings"
         },
-        "use_selection30": {
+        "use_selection31": {
             "use": "3d25ea99-4f33-489a-934c-0e42027e6114",
             "as": "GiteaOrg"
         },
-        "use_selection31": {
+        "use_selection32": {
             "use": "0a69cfc5-3223-4afb-8c9a-75f4bacf3c0e",
             "as": "GiteaUser"
         },
-        "use_selection32": {
+        "use_selection33": {
             "use": "0bb2b72f-ebcd-46fe-844b-ac5fe715c230",
             "as": "GiteaRepo"
         },
-        "use_selection33": {
+        "use_selection34": {
             "use": "808da4eb-b467-46cf-a767-e7e714f46b5a",
             "as": "GiteaPackage"
         },
-        "use_selection34": {
+        "use_selection35": {
             "use": "44396eb8-e14c-47d9-9bdc-8205c0fd2bba",
             "as": "GiteaIssue"
         },
-        "use_selection35": {
+        "use_selection36": {
             "use": "be57f70f-1214-4d69-8d33-7cd4e312ff70",
             "as": "GiteNotifi"
         },
-        "use_selection36": {
+        "use_selection37": {
             "use": "012af7d0-3436-4cae-b856-be49bdc39a3e",
             "as": "GiteaMisc"
         },
-        "use_selection37": {
+        "use_selection38": {
             "use": "ddced4c5-667d-4559-873d-d716c17fd85b",
             "as": "GiteaAdmin"
         }
diff --git a/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/README.md b/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/README.md
index eaddb33..3f95c4e 100644
--- a/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/README.md
+++ b/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/README.md
@@ -6,13 +6,14 @@
 ██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
 ╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
 ```
-# final class Update (Details)
+# class Update (Details)
 > namespace: **VDM\Joomla\Componentbuilder\Power\Database**
 ```uml
 @startuml
-class Update << (F,LightGreen) >> #RoyalBlue {
+class Update  #Gold {
   # Model $model
   # Database $database
+  # string $table
   + __construct(Model $model, Database $database)
   + value(mixed $value, string $field, ...) : bool
   + row(array $item) : bool
diff --git a/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.php b/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.php
index c2e65a5..759c75a 100644
--- a/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.php
+++ b/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.php
@@ -12,8 +12,9 @@
 namespace VDM\Joomla\Componentbuilder\Power\Database;
 
 
-use VDM\Joomla\Componentbuilder\Power\Model\Upsert as Model;
+use VDM\Joomla\Interfaces\ModelInterface as Model;
 use VDM\Joomla\Database\Update as Database;
+use VDM\Joomla\Componentbuilder\Interfaces\Database\UpdateInterface;
 
 
 /**
@@ -21,7 +22,7 @@ use VDM\Joomla\Database\Update as Database;
  * 
  * @since 3.2.0
  */
-final class Update
+class Update implements UpdateInterface
 {
 	/**
 	 * Model
@@ -39,6 +40,14 @@ final class Update
 	 */
 	protected Database $database;
 
+	/**
+	 * Table Name
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 */
+	protected string $table = 'power';
+
 	/**
 	 * Constructor
 	 *
@@ -88,10 +97,10 @@ final class Update
 	public function row(array $item): bool
 	{
 		// check if object could be modelled
-		if (($item = $this->model->row($item, 'power')) !== null)
+		if (($item = $this->model->row($item, $this->table)) !== null)
 		{
 			// Update the column of this table using guid as the primary key.
-			return $this->database->row($item, 'guid', 'power');
+			return $this->database->row($item, 'guid', $this->table);
 		}
 		return false;
 	}
@@ -108,10 +117,10 @@ final class Update
 	public function rows(?array $items): bool
 	{
 		// check if object could be modelled
-		if (($items = $this->model->rows($items, 'power')) !== null)
+		if (($items = $this->model->rows($items, $this->table)) !== null)
 		{
 			// Update the column of this table using guid as the primary key.
-			return $this->database->rows($items, 'guid', 'power');
+			return $this->database->rows($items, 'guid', $this->table);
 		}
 		return false;
 	}
@@ -128,10 +137,10 @@ final class Update
 	public function item(object $item): bool
 	{
 		// check if object could be modelled
-		if (($item = $this->model->item($item, 'power')) !== null)
+		if (($item = $this->model->item($item, $this->table)) !== null)
 		{
 			// Update the column of this table using guid as the primary key.
-			return $this->database->item($item, 'guid', 'power');
+			return $this->database->item($item, 'guid', $this->table);
 		}
 		return false;
 	}
@@ -148,10 +157,10 @@ final class Update
 	public function items(?array $items): bool
 	{
 		// check if object could be modelled
-		if (($items = $this->model->items($items, 'power')) !== null)
+		if (($items = $this->model->items($items, $this->table)) !== null)
 		{
 			// Update the column of this table using guid as the primary key.
-			return $this->database->items($items, 'guid', 'power');
+			return $this->database->items($items, 'guid', $this->table);
 		}
 		return false;
 	}
diff --git a/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.power b/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.power
index 875838e..f5b7871 100644
--- a/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.power
+++ b/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/code.power
@@ -14,6 +14,14 @@
 	 */
 	protected Database $database;
 
+	/**
+	 * Table Name
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 */
+	protected string $table = 'power';
+
 	/**
 	 * Constructor
 	 *
@@ -63,10 +71,10 @@
 	public function row(array $item): bool
 	{
 		// check if object could be modelled
-		if (($item = $this->model->row($item, 'power')) !== null)
+		if (($item = $this->model->row($item, $this->table)) !== null)
 		{
 			// Update the column of this table using guid as the primary key.
-			return $this->database->row($item, 'guid', 'power');
+			return $this->database->row($item, 'guid', $this->table);
 		}
 		return false;
 	}
@@ -83,10 +91,10 @@
 	public function rows(?array $items): bool
 	{
 		// check if object could be modelled
-		if (($items = $this->model->rows($items, 'power')) !== null)
+		if (($items = $this->model->rows($items, $this->table)) !== null)
 		{
 			// Update the column of this table using guid as the primary key.
-			return $this->database->rows($items, 'guid', 'power');
+			return $this->database->rows($items, 'guid', $this->table);
 		}
 		return false;
 	}
@@ -103,10 +111,10 @@
 	public function item(object $item): bool
 	{
 		// check if object could be modelled
-		if (($item = $this->model->item($item, 'power')) !== null)
+		if (($item = $this->model->item($item, $this->table)) !== null)
 		{
 			// Update the column of this table using guid as the primary key.
-			return $this->database->item($item, 'guid', 'power');
+			return $this->database->item($item, 'guid', $this->table);
 		}
 		return false;
 	}
@@ -123,10 +131,10 @@
 	public function items(?array $items): bool
 	{
 		// check if object could be modelled
-		if (($items = $this->model->items($items, 'power')) !== null)
+		if (($items = $this->model->items($items, $this->table)) !== null)
 		{
 			// Update the column of this table using guid as the primary key.
-			return $this->database->items($items, 'guid', 'power');
+			return $this->database->items($items, 'guid', $this->table);
 		}
 		return false;
 	}
\ No newline at end of file
diff --git a/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/settings.json b/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/settings.json
index 8c3f745..811a4fa 100644
--- a/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/settings.json
+++ b/src/e543c123-b1d9-4a0b-83b2-a9d371da5ff3/settings.json
@@ -3,15 +3,17 @@
     "add_licensing_template": "2",
     "extends": "0",
     "guid": "e543c123-b1d9-4a0b-83b2-a9d371da5ff3",
-    "implements": null,
+    "implements": [
+        "69c29be3-ab25-4f56-944e-7ada6307b10c"
+    ],
     "load_selection": null,
     "name": "Update",
     "power_version": "1.0.0",
     "system_name": "JCB.Power.Database.Update",
-    "type": "final class",
+    "type": "class",
     "use_selection": {
         "use_selection0": {
-            "use": "7c1fb50f-8fb1-4627-8705-6fedf7182ca5",
+            "use": "8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff",
             "as": "Model"
         },
         "use_selection1": {
diff --git a/src/e923311a-4058-4e81-9f67-5956fd0c627c/README.md b/src/e923311a-4058-4e81-9f67-5956fd0c627c/README.md
new file mode 100644
index 0000000..d5a9bfc
--- /dev/null
+++ b/src/e923311a-4058-4e81-9f67-5956fd0c627c/README.md
@@ -0,0 +1,37 @@
+```
+██████╗  ██████╗ ██╗    ██╗███████╗██████╗
+██╔══██╗██╔═══██╗██║    ██║██╔════╝██╔══██╗
+██████╔╝██║   ██║██║ █╗ ██║█████╗  ██████╔╝
+██╔═══╝ ██║   ██║██║███╗██║██╔══╝  ██╔══██╗
+██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
+╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
+```
+# interface InjectorInterface (Details)
+> namespace: **VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power**
+```uml
+@startuml
+interface InjectorInterface  #Lavender {
+  + power(string $code) : string
+}
+
+note right of InjectorInterface::power
+  Inject the powers found in the code
+
+  since: 3.2.0
+  return: string
+end note
+ 
+@enduml
+```
+
+---
+```
+     ██╗ ██████╗██████╗
+     ██║██╔════╝██╔══██╗
+     ██║██║     ██████╔╝
+██   ██║██║     ██╔══██╗
+╚█████╔╝╚██████╗██████╔╝
+ ╚════╝  ╚═════╝╚═════╝
+```
+> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+
diff --git a/src/e923311a-4058-4e81-9f67-5956fd0c627c/code.php b/src/e923311a-4058-4e81-9f67-5956fd0c627c/code.php
new file mode 100644
index 0000000..136ad1b
--- /dev/null
+++ b/src/e923311a-4058-4e81-9f67-5956fd0c627c/code.php
@@ -0,0 +1,31 @@
+
+ * @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\Compiler\Interfaces\Power;
+
+
+/**
+ * Compiler Power Injector
+ * @since 3.2.1
+ */
+interface InjectorInterface
+{
+	/**
+	 * Inject the powers found in the code
+	 *
+	 * @param string   $code The class code
+	 *
+	 * @return string   The updated code
+	 * @since 3.2.0
+	 */
+	public function power(string $code): string;
+}
+
diff --git a/src/e923311a-4058-4e81-9f67-5956fd0c627c/code.power b/src/e923311a-4058-4e81-9f67-5956fd0c627c/code.power
new file mode 100644
index 0000000..f1f2ba1
--- /dev/null
+++ b/src/e923311a-4058-4e81-9f67-5956fd0c627c/code.power
@@ -0,0 +1,9 @@
+	/**
+	 * Inject the powers found in the code
+	 *
+	 * @param string   $code The class code
+	 *
+	 * @return string   The updated code
+	 * @since 3.2.0
+	 */
+	public function power(string $code): string;
\ No newline at end of file
diff --git a/src/e923311a-4058-4e81-9f67-5956fd0c627c/settings.json b/src/e923311a-4058-4e81-9f67-5956fd0c627c/settings.json
new file mode 100644
index 0000000..df69c20
--- /dev/null
+++ b/src/e923311a-4058-4e81-9f67-5956fd0c627c/settings.json
@@ -0,0 +1,18 @@
+{
+    "add_head": "0",
+    "add_licensing_template": "2",
+    "extends": "0",
+    "guid": "e923311a-4058-4e81-9f67-5956fd0c627c",
+    "implements": null,
+    "load_selection": null,
+    "name": "InjectorInterface",
+    "power_version": "1.0.0",
+    "system_name": "JCB.Compiler.Interfaces.Power.InjectorInterface",
+    "type": "interface",
+    "use_selection": null,
+    "namespace": "VDM\\Joomla\\Componentbuilder.Compiler.Interfaces.Power.InjectorInterface",
+    "description": "Compiler Power Injector\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": ""
+}
\ No newline at end of file
diff --git a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/README.md b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/README.md
index f4cf28a..0acc1c7 100644
--- a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/README.md
+++ b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/README.md
@@ -6,11 +6,12 @@
 ██║     ╚██████╔╝╚███╔███╔╝███████╗██║  ██║
 ╚═╝      ╚═════╝  ╚══╝╚══╝ ╚══════╝╚═╝  ╚═╝
 ```
-# final class Extractor (Details)
+# class Extractor (Details)
 > namespace: **VDM\Joomla\Componentbuilder\Compiler\Power**
 ```uml
 @startuml
-class Extractor << (F,LightGreen) >> #RoyalBlue {
+class Extractor  #Gold {
+  # string $table
   # array $powers
   # $db
   + __construct()
diff --git a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php
index 8dafcfb..beba4d5 100644
--- a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php
+++ b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.php
@@ -14,13 +14,14 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Power;
 
 use Joomla\CMS\Factory;
 use VDM\Joomla\Utilities\GuidHelper;
+use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Power\ExtractorInterface;
 
 
 /**
  * Compiler Power Extractor
  * @since 3.2.0
  */
-final class Extractor
+class Extractor implements ExtractorInterface
 {
 	/**
 	 * The pattern to get the powers
@@ -30,6 +31,30 @@ final class Extractor
 	 **/
 	protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
 
+	/**
+	 * The pattern to get the Front
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $_pattern = 'Super';
+
+	/**
+	 * The pattern to get the Back
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $pattern_ = 'Power';
+
+	/**
+	 * The Table
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $table = 'power';
+
 	/**
 	 * Powers GUID's
 	 *
@@ -147,7 +172,7 @@ final class Extractor
 	{
 		foreach ($found as $super_power)
 		{
-			$guid = str_replace(['Super_'.'_'.'_', '_'.'_'.'_Power'], '', $super_power);
+			$guid = str_replace([], '', $super_power);
 			$guid = str_replace('_', '-', $guid);
 
 			if (GuidHelper::valid($guid))
@@ -171,7 +196,7 @@ final class Extractor
 
 		foreach ($found as $super_power)
 		{
-			$guid = str_replace(['Super_'.'_'.'_', '_'.'_'.'_Power'], '', $super_power);
+			$guid = str_replace([$this->_pattern . '___', '___' . $this->pattern_], '', $super_power);
 			$guid = str_replace('_', '-', $guid);
 
 			if (GuidHelper::valid($guid))
@@ -197,7 +222,7 @@ final class Extractor
 
 		foreach ($found as $super_power)
 		{
-			$guid = str_replace(['Super_'.'_'.'_', '_'.'_'.'_Power'], '', $super_power);
+			$guid = str_replace([$this->_pattern . '___', '___' . $this->pattern_], '', $super_power);
 			$guid = str_replace('_', '-', $guid);
 
 			if (GuidHelper::valid($guid))
@@ -226,7 +251,7 @@ final class Extractor
 			. ', ".", "\\\") AS full_namespace, '
 			. $this->db->quoteName('guid')
 			)
-			->from($this->db->quoteName('#__componentbuilder_power'))
+			->from($this->db->quoteName('#__componentbuilder_' . $this->table))
 			->where($this->db->quoteName('guid') . ' IN (' . implode(',', array_map([$this->db, 'quote'], $guids)) . ')');
 		$this->db->setQuery($query);
 		$this->db->execute();
diff --git a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.power b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.power
index 539e4eb..613353c 100644
--- a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.power
+++ b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/code.power
@@ -6,6 +6,30 @@
 	 **/
 	protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/';
 
+	/**
+	 * The pattern to get the Front
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $_pattern = 'Super';
+
+	/**
+	 * The pattern to get the Back
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $pattern_ = 'Power';
+
+	/**
+	 * The Table
+	 *
+	 * @var    string
+	 * @since 3.2.1
+	 **/
+	protected string $table = 'power';
+
 	/**
 	 * Powers GUID's
 	 *
@@ -123,7 +147,7 @@
 	{
 		foreach ($found as $super_power)
 		{
-			$guid = str_replace(['Super_'.'_'.'_', '_'.'_'.'_Power'], '', $super_power);
+			$guid = str_replace([], '', $super_power);
 			$guid = str_replace('_', '-', $guid);
 
 			if (GuidHelper::valid($guid))
@@ -147,7 +171,7 @@
 
 		foreach ($found as $super_power)
 		{
-			$guid = str_replace(['Super_'.'_'.'_', '_'.'_'.'_Power'], '', $super_power);
+			$guid = str_replace([$this->_pattern . '___', '___' . $this->pattern_], '', $super_power);
 			$guid = str_replace('_', '-', $guid);
 
 			if (GuidHelper::valid($guid))
@@ -173,7 +197,7 @@
 
 		foreach ($found as $super_power)
 		{
-			$guid = str_replace(['Super_'.'_'.'_', '_'.'_'.'_Power'], '', $super_power);
+			$guid = str_replace([$this->_pattern . '___', '___' . $this->pattern_], '', $super_power);
 			$guid = str_replace('_', '-', $guid);
 
 			if (GuidHelper::valid($guid))
@@ -202,7 +226,7 @@
 			. ', ".", "\\\") AS full_namespace, '
 			. $this->db->quoteName('guid')
 			)
-			->from($this->db->quoteName('#__componentbuilder_power'))
+			->from($this->db->quoteName('#__componentbuilder_' . $this->table))
 			->where($this->db->quoteName('guid') . ' IN (' . implode(',', array_map([$this->db, 'quote'], $guids)) . ')');
 		$this->db->setQuery($query);
 		$this->db->execute();
diff --git a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/settings.json b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/settings.json
index 912d559..279b580 100644
--- a/src/eeb03266-22fd-45bb-953a-961bb6be3a54/settings.json
+++ b/src/eeb03266-22fd-45bb-953a-961bb6be3a54/settings.json
@@ -3,12 +3,14 @@
     "add_licensing_template": "2",
     "extends": "0",
     "guid": "eeb03266-22fd-45bb-953a-961bb6be3a54",
-    "implements": null,
+    "implements": [
+        "c159425c-51f9-4a15-af99-f2d0c6d7aae8"
+    ],
     "load_selection": null,
     "name": "Extractor",
     "power_version": "1.0.0",
     "system_name": "JCB.Compiler.Power.Extractor",
-    "type": "final class",
+    "type": "class",
     "use_selection": {
         "use_selection0": {
             "use": "9c513baf-b279-43fd-ae29-a585c8cbc4f0",
diff --git a/super-powers.json b/super-powers.json
index 73537f9..6661e26 100644
--- a/super-powers.json
+++ b/super-powers.json
@@ -87,6 +87,17 @@
         "spk": "Super__05448890_e324_41a0_b6db_d804bfc241cc__Power",
         "guid": "05448890-e324-41a0-b6db-d804bfc241cc"
     },
+    "05744dd3-4030-4cf8-8dda-a93ab809b473": {
+        "name": "Load",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower\\Model",
+        "code": "src\/05744dd3-4030-4cf8-8dda-a93ab809b473\/code.php",
+        "power": "src\/05744dd3-4030-4cf8-8dda-a93ab809b473\/code.power",
+        "settings": "src\/05744dd3-4030-4cf8-8dda-a93ab809b473\/settings.json",
+        "path": "src\/05744dd3-4030-4cf8-8dda-a93ab809b473",
+        "spk": "Super__05744dd3_4030_4cf8_8dda_a93ab809b473__Power",
+        "guid": "05744dd3-4030-4cf8-8dda-a93ab809b473"
+    },
     "05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46": {
         "name": "Data",
         "type": "class",
@@ -474,7 +485,7 @@
     },
     "1f86db0f-e271-45df-8795-3e503ec76698": {
         "name": "Load",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Power\\Database",
         "code": "src\/1f86db0f-e271-45df-8795-3e503ec76698\/code.php",
         "power": "src\/1f86db0f-e271-45df-8795-3e503ec76698\/code.power",
@@ -912,6 +923,17 @@
         "spk": "Super__35191b0c_f7f3_44d6_8ec1_c816b997bd4e__Power",
         "guid": "35191b0c-f7f3-44d6-8ec1-c816b997bd4e"
     },
+    "355bf21a-f859-4528-9110-bcd2c6d05ea7": {
+        "name": "Grep",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower",
+        "code": "src\/355bf21a-f859-4528-9110-bcd2c6d05ea7\/code.php",
+        "power": "src\/355bf21a-f859-4528-9110-bcd2c6d05ea7\/code.power",
+        "settings": "src\/355bf21a-f859-4528-9110-bcd2c6d05ea7\/settings.json",
+        "path": "src\/355bf21a-f859-4528-9110-bcd2c6d05ea7",
+        "spk": "Super__355bf21a_f859_4528_9110_bcd2c6d05ea7__Power",
+        "guid": "355bf21a-f859-4528-9110-bcd2c6d05ea7"
+    },
     "369ae3f5-90db-43b9-aba9-ce5c83311c4e": {
         "name": "ServiceProvider",
         "type": "final class",
@@ -934,9 +956,20 @@
         "spk": "Super__36d49d4a_8d0e_435f_ab4c_8f247d96fd4d__Power",
         "guid": "36d49d4a-8d0e-435f-ab4c-8f247d96fd4d"
     },
+    "3730a000-ab64-477d-8b0f-70eaf71b517a": {
+        "name": "JoomlaPower",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler",
+        "code": "src\/3730a000-ab64-477d-8b0f-70eaf71b517a\/code.php",
+        "power": "src\/3730a000-ab64-477d-8b0f-70eaf71b517a\/code.power",
+        "settings": "src\/3730a000-ab64-477d-8b0f-70eaf71b517a\/settings.json",
+        "path": "src\/3730a000-ab64-477d-8b0f-70eaf71b517a",
+        "spk": "Super__3730a000_ab64_477d_8b0f_70eaf71b517a__Power",
+        "guid": "3730a000-ab64-477d-8b0f-70eaf71b517a"
+    },
     "380bb7a3-cdcc-4336-a699-5070cbf521a5": {
         "name": "Insert",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Power\\Database",
         "code": "src\/380bb7a3-cdcc-4336-a699-5070cbf521a5\/code.php",
         "power": "src\/380bb7a3-cdcc-4336-a699-5070cbf521a5\/code.power",
@@ -956,6 +989,17 @@
         "spk": "Super__396f9883_4e50_4b65_a1d5_05bd6c23df30__Power",
         "guid": "396f9883-4e50-4b65-a1d5-05bd6c23df30"
     },
+    "39a75870-a7f7-45fd-937d-5ba97b85b8ad": {
+        "name": "Super",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower",
+        "code": "src\/39a75870-a7f7-45fd-937d-5ba97b85b8ad\/code.php",
+        "power": "src\/39a75870-a7f7-45fd-937d-5ba97b85b8ad\/code.power",
+        "settings": "src\/39a75870-a7f7-45fd-937d-5ba97b85b8ad\/settings.json",
+        "path": "src\/39a75870-a7f7-45fd-937d-5ba97b85b8ad",
+        "spk": "Super__39a75870_a7f7_45fd_937d_5ba97b85b8ad__Power",
+        "guid": "39a75870-a7f7-45fd-937d-5ba97b85b8ad"
+    },
     "39ea8150-f124-4e47-909d-641bf1c96d5e": {
         "name": "Data",
         "type": "class",
@@ -980,7 +1024,7 @@
     },
     "3ab0eba9-f37b-4b37-aec1-2e78067f2aff": {
         "name": "Super",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Power",
         "code": "src\/3ab0eba9-f37b-4b37-aec1-2e78067f2aff\/code.php",
         "power": "src\/3ab0eba9-f37b-4b37-aec1-2e78067f2aff\/code.power",
@@ -1308,6 +1352,17 @@
         "spk": "Super__516f93b8_5fff_41c6_aeaf_2d93180a12cc__Power",
         "guid": "516f93b8-5fff-41c6-aeaf-2d93180a12cc"
     },
+    "51de80f2-2868-4c2c-8198-ef79349e9bd7": {
+        "name": "SuperInterface",
+        "type": "interface",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces",
+        "code": "src\/51de80f2-2868-4c2c-8198-ef79349e9bd7\/code.php",
+        "power": "src\/51de80f2-2868-4c2c-8198-ef79349e9bd7\/code.power",
+        "settings": "src\/51de80f2-2868-4c2c-8198-ef79349e9bd7\/settings.json",
+        "path": "src\/51de80f2-2868-4c2c-8198-ef79349e9bd7",
+        "spk": "Super__51de80f2_2868_4c2c_8198_ef79349e9bd7__Power",
+        "guid": "51de80f2-2868-4c2c-8198-ef79349e9bd7"
+    },
     "52de0ac8-bb9d-4a45-bd2a-a44c48c17ffe": {
         "name": "SiteFields",
         "type": "final class",
@@ -1374,6 +1429,17 @@
         "spk": "Super__56ba30f5_a5c4_4c4c_be6f_a56f7f9cbc60__Power",
         "guid": "56ba30f5-a5c4-4c4c-be6f-a56f7f9cbc60"
     },
+    "5716c79f-a1c9-4059-9d00-8cccb9f9e061": {
+        "name": "JoomlaPower",
+        "type": "class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Service",
+        "code": "src\/5716c79f-a1c9-4059-9d00-8cccb9f9e061\/code.php",
+        "power": "src\/5716c79f-a1c9-4059-9d00-8cccb9f9e061\/code.power",
+        "settings": "src\/5716c79f-a1c9-4059-9d00-8cccb9f9e061\/settings.json",
+        "path": "src\/5716c79f-a1c9-4059-9d00-8cccb9f9e061",
+        "spk": "Super__5716c79f_a1c9_4059_9d00_8cccb9f9e061__Power",
+        "guid": "5716c79f-a1c9-4059-9d00-8cccb9f9e061"
+    },
     "58b7f907-4195-4ca3-886c-17877be59887": {
         "name": "DatabaseUniqueGuid",
         "type": "final class",
@@ -1574,7 +1640,7 @@
     },
     "6784dd52-0909-451a-a872-9a942a023c68": {
         "name": "Grep",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Power",
         "code": "src\/6784dd52-0909-451a-a872-9a942a023c68\/code.php",
         "power": "src\/6784dd52-0909-451a-a872-9a942a023c68\/code.power",
@@ -1583,6 +1649,17 @@
         "spk": "Super__6784dd52_0909_451a_a872_9a942a023c68__Power",
         "guid": "6784dd52-0909-451a-a872-9a942a023c68"
     },
+    "679473f6-3ea2-49d5-8273-1b29c8f0ad2b": {
+        "name": "Update",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower\\Database",
+        "code": "src\/679473f6-3ea2-49d5-8273-1b29c8f0ad2b\/code.php",
+        "power": "src\/679473f6-3ea2-49d5-8273-1b29c8f0ad2b\/code.power",
+        "settings": "src\/679473f6-3ea2-49d5-8273-1b29c8f0ad2b\/settings.json",
+        "path": "src\/679473f6-3ea2-49d5-8273-1b29c8f0ad2b",
+        "spk": "Super__679473f6_3ea2_49d5_8273_1b29c8f0ad2b__Power",
+        "guid": "679473f6-3ea2-49d5-8273-1b29c8f0ad2b"
+    },
     "6992384f-4f29-489f-a52e-286e03f4593b": {
         "name": "HasMenuGlobal",
         "type": "final class",
@@ -1594,6 +1671,17 @@
         "spk": "Super__6992384f_4f29_489f_a52e_286e03f4593b__Power",
         "guid": "6992384f-4f29-489f-a52e-286e03f4593b"
     },
+    "69c29be3-ab25-4f56-944e-7ada6307b10c": {
+        "name": "UpdateInterface",
+        "type": "interface",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces\\Database",
+        "code": "src\/69c29be3-ab25-4f56-944e-7ada6307b10c\/code.php",
+        "power": "src\/69c29be3-ab25-4f56-944e-7ada6307b10c\/code.power",
+        "settings": "src\/69c29be3-ab25-4f56-944e-7ada6307b10c\/settings.json",
+        "path": "src\/69c29be3-ab25-4f56-944e-7ada6307b10c",
+        "spk": "Super__69c29be3_ab25_4f56_944e_7ada6307b10c__Power",
+        "guid": "69c29be3-ab25-4f56-944e-7ada6307b10c"
+    },
     "69d2b980-a665-48cd-96f8-757bf3810b41": {
         "name": "Settings",
         "type": "final class",
@@ -1704,6 +1792,17 @@
         "spk": "Super__6e64917c_d687_4ef3_a655_811319f5a81e__Power",
         "guid": "6e64917c-d687-4ef3-a655-811319f5a81e"
     },
+    "6ee3dc9e-1949-4da5-a74f-d9eb7f14e400": {
+        "name": "Factory",
+        "type": "abstract class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower",
+        "code": "src\/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400\/code.php",
+        "power": "src\/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400\/code.power",
+        "settings": "src\/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400\/settings.json",
+        "path": "src\/6ee3dc9e-1949-4da5-a74f-d9eb7f14e400",
+        "spk": "Super__6ee3dc9e_1949_4da5_a74f_d9eb7f14e400__Power",
+        "guid": "6ee3dc9e-1949-4da5-a74f-d9eb7f14e400"
+    },
     "6f20369a-8536-4870-a1a3-cda254c939c8": {
         "name": "Paths",
         "type": "class",
@@ -1783,7 +1882,7 @@
     },
     "763d137c-42bc-4282-98d8-cc5c0654985f": {
         "name": "Injector",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power",
         "code": "src\/763d137c-42bc-4282-98d8-cc5c0654985f\/code.php",
         "power": "src\/763d137c-42bc-4282-98d8-cc5c0654985f\/code.power",
@@ -1882,7 +1981,7 @@
     },
     "7c1fb50f-8fb1-4627-8705-6fedf7182ca5": {
         "name": "Upsert",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Power\\Model",
         "code": "src\/7c1fb50f-8fb1-4627-8705-6fedf7182ca5\/code.php",
         "power": "src\/7c1fb50f-8fb1-4627-8705-6fedf7182ca5\/code.power",
@@ -1935,6 +2034,17 @@
         "spk": "Super__81de8f57_dd9c_4a17_964f_848cd4a0743b__Power",
         "guid": "81de8f57-dd9c-4a17-964f-848cd4a0743b"
     },
+    "82505f3f-297f-4d75-a581-929ab3e93689": {
+        "name": "Extractor",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaPower",
+        "code": "src\/82505f3f-297f-4d75-a581-929ab3e93689\/code.php",
+        "power": "src\/82505f3f-297f-4d75-a581-929ab3e93689\/code.power",
+        "settings": "src\/82505f3f-297f-4d75-a581-929ab3e93689\/settings.json",
+        "path": "src\/82505f3f-297f-4d75-a581-929ab3e93689",
+        "spk": "Super__82505f3f_297f_4d75_a581_929ab3e93689__Power",
+        "guid": "82505f3f-297f-4d75-a581-929ab3e93689"
+    },
     "84c11075-570a-4907-9be0-9305e0fabe3c": {
         "name": "ConfigFieldsetsUikit",
         "type": "final class",
@@ -2155,6 +2265,17 @@
         "spk": "Super__9127e428_5dee_46cb_b3a9_ab5b91ea6df3__Power",
         "guid": "9127e428-5dee-46cb-b3a9-ab5b91ea6df3"
     },
+    "9206082e-a3f7-472e-98b2-de90d06cbdcd": {
+        "name": "Upsert",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower\\Model",
+        "code": "src\/9206082e-a3f7-472e-98b2-de90d06cbdcd\/code.php",
+        "power": "src\/9206082e-a3f7-472e-98b2-de90d06cbdcd\/code.power",
+        "settings": "src\/9206082e-a3f7-472e-98b2-de90d06cbdcd\/settings.json",
+        "path": "src\/9206082e-a3f7-472e-98b2-de90d06cbdcd",
+        "spk": "Super__9206082e_a3f7_472e_98b2_de90d06cbdcd__Power",
+        "guid": "9206082e-a3f7-472e-98b2-de90d06cbdcd"
+    },
     "92cc3144-1d3d-45b2-b49f-c7d356950033": {
         "name": "Customtabs",
         "type": "final class",
@@ -2232,6 +2353,17 @@
         "spk": "Super__9551b683_67b6_4367_bb14_4b016def37e3__Power",
         "guid": "9551b683-67b6-4367-bb14-4b016def37e3"
     },
+    "95c02df3-fe0a-405b-b506-b7a5b8605b66": {
+        "name": "InsertInterface",
+        "type": "interface",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces\\Database",
+        "code": "src\/95c02df3-fe0a-405b-b506-b7a5b8605b66\/code.php",
+        "power": "src\/95c02df3-fe0a-405b-b506-b7a5b8605b66\/code.power",
+        "settings": "src\/95c02df3-fe0a-405b-b506-b7a5b8605b66\/settings.json",
+        "path": "src\/95c02df3-fe0a-405b-b506-b7a5b8605b66",
+        "spk": "Super__95c02df3_fe0a_405b_b506_b7a5b8605b66__Power",
+        "guid": "95c02df3-fe0a-405b-b506-b7a5b8605b66"
+    },
     "95d0e03f-24fd-4412-bc2e-f0899fcc3205": {
         "name": "Parser",
         "type": "final class",
@@ -2331,6 +2463,17 @@
         "spk": "Super__99368a6f_2f64_4d4e_ad3a_544d4020ecc6__Power",
         "guid": "99368a6f-2f64-4d4e-ad3a-544d4020ecc6"
     },
+    "99786f53-64b7-4d52-95b0-5306e7386c3f": {
+        "name": "LoadInterface",
+        "type": "interface",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Power\\Database",
+        "code": "src\/99786f53-64b7-4d52-95b0-5306e7386c3f\/code.php",
+        "power": "src\/99786f53-64b7-4d52-95b0-5306e7386c3f\/code.power",
+        "settings": "src\/99786f53-64b7-4d52-95b0-5306e7386c3f\/settings.json",
+        "path": "src\/99786f53-64b7-4d52-95b0-5306e7386c3f",
+        "spk": "Super__99786f53_64b7_4d52_95b0_5306e7386c3f__Power",
+        "guid": "99786f53-64b7-4d52-95b0-5306e7386c3f"
+    },
     "9b5872d6-c1d8-4602-b443-5844d2c950ee": {
         "name": "AssetsRules",
         "type": "final class",
@@ -2375,6 +2518,17 @@
         "spk": "Super__9d1eec29_f304_4b08_a3e7_8b2d6b1f4a1f__Power",
         "guid": "9d1eec29-f304-4b08-a3e7-8b2d6b1f4a1f"
     },
+    "9d53d45e-9b4d-45ec-827b-4916b91c907e": {
+        "name": "Insert",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower\\Database",
+        "code": "src\/9d53d45e-9b4d-45ec-827b-4916b91c907e\/code.php",
+        "power": "src\/9d53d45e-9b4d-45ec-827b-4916b91c907e\/code.power",
+        "settings": "src\/9d53d45e-9b4d-45ec-827b-4916b91c907e\/settings.json",
+        "path": "src\/9d53d45e-9b4d-45ec-827b-4916b91c907e",
+        "spk": "Super__9d53d45e_9b4d_45ec_827b_4916b91c907e__Power",
+        "guid": "9d53d45e-9b4d-45ec-827b-4916b91c907e"
+    },
     "9d74d613-5ef7-4cf1-9f12-64f0a8e19806": {
         "name": "CustomAlias",
         "type": "final class",
@@ -2452,6 +2606,17 @@
         "spk": "Super__a1e551a9_8369_48c9_a076_4e5beb65e0df__Power",
         "guid": "a1e551a9-8369-48c9-a076-4e5beb65e0df"
     },
+    "a2992a91-eec2-4957-811b-8cde22aa1438": {
+        "name": "Database",
+        "type": "class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower\\Service",
+        "code": "src\/a2992a91-eec2-4957-811b-8cde22aa1438\/code.php",
+        "power": "src\/a2992a91-eec2-4957-811b-8cde22aa1438\/code.power",
+        "settings": "src\/a2992a91-eec2-4957-811b-8cde22aa1438\/settings.json",
+        "path": "src\/a2992a91-eec2-4957-811b-8cde22aa1438",
+        "spk": "Super__a2992a91_eec2_4957_811b_8cde22aa1438__Power",
+        "guid": "a2992a91-eec2-4957-811b-8cde22aa1438"
+    },
     "a356d103-74f3-49ca-8e4f-3bd37746f089": {
         "name": "Customcode",
         "type": "class",
@@ -2518,6 +2683,17 @@
         "spk": "Super__a601888d_12b6_427f_94ae_95004206e24e__Power",
         "guid": "a601888d-12b6-427f-94ae-95004206e24e"
     },
+    "a6052fe9-0d2b-4b36-b3e7-03b47c483542": {
+        "name": "Injector",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\JoomlaPower",
+        "code": "src\/a6052fe9-0d2b-4b36-b3e7-03b47c483542\/code.php",
+        "power": "src\/a6052fe9-0d2b-4b36-b3e7-03b47c483542\/code.power",
+        "settings": "src\/a6052fe9-0d2b-4b36-b3e7-03b47c483542\/settings.json",
+        "path": "src\/a6052fe9-0d2b-4b36-b3e7-03b47c483542",
+        "spk": "Super__a6052fe9_0d2b_4b36_b3e7_03b47c483542__Power",
+        "guid": "a6052fe9-0d2b-4b36-b3e7-03b47c483542"
+    },
     "a68c010b-e92e-47d5-8a44-d23cfddeb6c6": {
         "name": "Indent",
         "type": "abstract class",
@@ -2749,6 +2925,17 @@
         "spk": "Super__b3c36de1_9b18_4ea8_8383_6ab8f0e33996__Power",
         "guid": "b3c36de1-9b18-4ea8-8383-6ab8f0e33996"
     },
+    "b4ea5de3-653f-43f9-b927-4ba6456b4d0a": {
+        "name": "Load",
+        "type": "final class",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\JoomlaPower\\Database",
+        "code": "src\/b4ea5de3-653f-43f9-b927-4ba6456b4d0a\/code.php",
+        "power": "src\/b4ea5de3-653f-43f9-b927-4ba6456b4d0a\/code.power",
+        "settings": "src\/b4ea5de3-653f-43f9-b927-4ba6456b4d0a\/settings.json",
+        "path": "src\/b4ea5de3-653f-43f9-b927-4ba6456b4d0a",
+        "spk": "Super__b4ea5de3_653f_43f9_b927_4ba6456b4d0a__Power",
+        "guid": "b4ea5de3-653f-43f9-b927-4ba6456b4d0a"
+    },
     "b5986fab-17ca-4236-8c0c-81ebd2bb82ba": {
         "name": "FieldsetDynamic",
         "type": "final class",
@@ -2850,7 +3037,7 @@
     },
     "bb29a833-73f7-4283-9327-bc7e41f0723b": {
         "name": "Load",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Power\\Model",
         "code": "src\/bb29a833-73f7-4283-9327-bc7e41f0723b\/code.php",
         "power": "src\/bb29a833-73f7-4283-9327-bc7e41f0723b\/code.power",
@@ -2936,6 +3123,28 @@
         "spk": "Super__c0e46033_5ade_4829_88b7_ca160d36a4d1__Power",
         "guid": "c0e46033-5ade-4829-88b7-ca160d36a4d1"
     },
+    "c159425c-51f9-4a15-af99-f2d0c6d7aae8": {
+        "name": "ExtractorInterface",
+        "type": "interface",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Power",
+        "code": "src\/c159425c-51f9-4a15-af99-f2d0c6d7aae8\/code.php",
+        "power": "src\/c159425c-51f9-4a15-af99-f2d0c6d7aae8\/code.power",
+        "settings": "src\/c159425c-51f9-4a15-af99-f2d0c6d7aae8\/settings.json",
+        "path": "src\/c159425c-51f9-4a15-af99-f2d0c6d7aae8",
+        "spk": "Super__c159425c_51f9_4a15_af99_f2d0c6d7aae8__Power",
+        "guid": "c159425c-51f9-4a15-af99-f2d0c6d7aae8"
+    },
+    "c182506a-ab84-439c-b962-1e606b58d545": {
+        "name": "GrepInterface",
+        "type": "interface",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Interfaces",
+        "code": "src\/c182506a-ab84-439c-b962-1e606b58d545\/code.php",
+        "power": "src\/c182506a-ab84-439c-b962-1e606b58d545\/code.power",
+        "settings": "src\/c182506a-ab84-439c-b962-1e606b58d545\/settings.json",
+        "path": "src\/c182506a-ab84-439c-b962-1e606b58d545",
+        "spk": "Super__c182506a_ab84_439c_b962_1e606b58d545__Power",
+        "guid": "c182506a-ab84-439c-b962-1e606b58d545"
+    },
     "c20a63e0-0eeb-4424-9d08-b1bf0f049dfe": {
         "name": "Phpadminview",
         "type": "class",
@@ -3488,7 +3697,7 @@
     },
     "e543c123-b1d9-4a0b-83b2-a9d371da5ff3": {
         "name": "Update",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Power\\Database",
         "code": "src\/e543c123-b1d9-4a0b-83b2-a9d371da5ff3\/code.php",
         "power": "src\/e543c123-b1d9-4a0b-83b2-a9d371da5ff3\/code.power",
@@ -3596,6 +3805,17 @@
         "spk": "Super__e85175fd_e297_46df_a497_27f7a37190fd__Power",
         "guid": "e85175fd-e297-46df-a497-27f7a37190fd"
     },
+    "e923311a-4058-4e81-9f67-5956fd0c627c": {
+        "name": "InjectorInterface",
+        "type": "interface",
+        "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Interfaces\\Power",
+        "code": "src\/e923311a-4058-4e81-9f67-5956fd0c627c\/code.php",
+        "power": "src\/e923311a-4058-4e81-9f67-5956fd0c627c\/code.power",
+        "settings": "src\/e923311a-4058-4e81-9f67-5956fd0c627c\/settings.json",
+        "path": "src\/e923311a-4058-4e81-9f67-5956fd0c627c",
+        "spk": "Super__e923311a_4058_4e81_9f67_5956fd0c627c__Power",
+        "guid": "e923311a-4058-4e81-9f67-5956fd0c627c"
+    },
     "e9b6b06b-f600-4f9d-984d-79c70ae7ae92": {
         "name": "ExtensionCustomFields",
         "type": "final class",
@@ -3686,7 +3906,7 @@
     },
     "eeb03266-22fd-45bb-953a-961bb6be3a54": {
         "name": "Extractor",
-        "type": "final class",
+        "type": "class",
         "namespace": "VDM\\Joomla\\Componentbuilder\\Compiler\\Power",
         "code": "src\/eeb03266-22fd-45bb-953a-961bb6be3a54\/code.php",
         "power": "src\/eeb03266-22fd-45bb-953a-961bb6be3a54\/code.power",