super-powers/src/9c513baf-b279-43fd-ae29-a585c8cbc4f0/README.md

96 lines
3.5 KiB
Markdown
Raw Permalink Normal View History

2023-07-04 06:26:08 +00:00
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# abstract class GuidHelper (Details)
2024-06-21 12:01:19 +00:00
> namespace: **VDM\Joomla\Utilities**
2024-07-16 12:12:10 +00:00
2023-07-04 06:26:08 +00:00
```uml
@startuml
abstract GuidHelper #Orange {
+ {static} get(bool $trim = true) : string
+ {static} valid(string $guid, ?string $table = null, ...) : bool
2024-01-27 07:08:12 +00:00
+ {static} item(string $guid, string $table, ...) : mixed
2023-07-04 06:26:08 +00:00
# {static} validate(string $guid) : bool
}
note right of GuidHelper::get
Returns a GUIDv4 string
Thanks to Dave Pearson (and other)
https://www.php.net/manual/en/function.com-create-guid.php#119168
Uses the best cryptographically secure method
for all supported platforms with fallback to an older,
less secure version.
since: 3.0.9
return: string
end note
note right of GuidHelper::valid
Validate the Globally Unique Identifier ( and check if table already has this identifier)
since: 3.0.9
return: bool
arguments:
string $guid
?string $table = null
int $id
?string $component = null
end note
note right of GuidHelper::item
get the item by guid in a table
since: 3.0.9
2024-01-27 07:08:12 +00:00
return: mixed
2023-07-04 06:26:08 +00:00
arguments:
string $guid
string $table
string|array $what = 'a.id'
?string $component = null
end note
note right of GuidHelper::validate
Validate the Globally Unique Identifier
Thanks to Lewie
https://stackoverflow.com/a/1515456/1429677
since: 3.0.9
return: bool
end note
@enduml
```
2024-07-16 12:12:10 +00:00
The Power feature in JCB allows you to write PHP classes and their implementations, making it easy to include them in your Joomla project. JCB handles linking, autoloading, namespacing, and folder structure creation for you.
By using the SPK (Super Power Key) in your custom code (replacing the class name in your code with the SPK), JCB will automatically pull the power from the repository into your project. This makes it available in your JCB instance, allowing you to edit it and include the class in your generated Joomla component.
JCB uses placeholders like [[[`NamespacePrefix`]]] and [[[`ComponentNamespace`]]] in namespacing to prevent collisions and improve reusability across different JCB systems. You can also set the **JCB powers path** globally or per component under the **Dynamic Integration** tab, providing flexibility and easy maintainability.
To add this specific Power to your project in JCB:
> simply use this SPK
```
Super---9c513baf_b279_43fd_ae29_a585c8cbc4f0---Power
```
> remember to replace the `---` with `___` to activate this Power in your code
2023-07-04 06:26:08 +00:00
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)