super-powers/src/eb7d69c2-4ee9-4bd0-aacc-ab51a12be895/README.md

341 lines
8.1 KiB
Markdown
Raw Normal View History

2024-07-08 21:10:45 +00:00
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
2024-07-20 20:42:08 +00:00
# abstract class Set (Details)
> namespace: **VDM\Joomla\Abstraction\Remote**
2024-07-16 12:12:10 +00:00
2024-07-08 21:10:45 +00:00
```uml
@startuml
2024-07-20 20:42:08 +00:00
abstract Set #Orange {
2024-07-08 21:10:45 +00:00
# Grep $grep
# Items $items
2024-07-16 12:12:10 +00:00
# ItemReadme $itemReadme
# MainReadme $mainReadme
2024-07-08 21:10:45 +00:00
# Git $git
+ array $repos
# string $table
2024-07-20 20:42:08 +00:00
# string $area
2024-07-08 21:10:45 +00:00
# array $map
2024-07-16 12:12:10 +00:00
# array $settings
2024-08-21 21:09:13 +00:00
# array $repoPlaceholders
2024-07-08 21:10:45 +00:00
+ __construct(array $repos, Grep $grep, ...)
+ table(string $table) : self
2024-07-20 20:42:08 +00:00
+ area(string $area) : self
2024-07-16 12:12:10 +00:00
+ setSettingsPath(string $settingsPath) : self
2024-07-20 20:42:08 +00:00
+ setIndexSettingsPath(string $settingsIndexPath) : self
2024-07-16 12:12:10 +00:00
+ items(array $guids) : bool
# {abstract} updateItem(object $item, object $existing, ...) : bool
# {abstract} createItem(object $item, object $repo) : void
# {abstract} updateItemReadme(object $item, object $existing, ...) : void
# {abstract} createItemReadme(object $item, object $repo) : void
2024-07-20 20:42:08 +00:00
# getTable() : string
# getArea() : string
# saveRepoMainSettings(array $repoBucket) : void
# isInvalidIndexRepo(mixed $repo, mixed $settings) : bool
# mergeIndexSettings(string $repoGuid, array $settings) : array
# updateIndexMainFile(object $repo, string $path, ...) : void
2024-07-16 12:12:10 +00:00
# getLocalItems(array $guids) : ?array
2024-07-08 21:10:45 +00:00
# mapItem(object $item) : object
2024-07-20 20:42:08 +00:00
# save(object $item) : void
2024-08-21 21:09:13 +00:00
# setRepoPlaceholders(object $repo) : void
# updatePlaceholders(string $string) : string
2024-07-20 20:42:08 +00:00
# getIndexItem(object $item) : ?array
2024-07-08 21:10:45 +00:00
# canWrite() : bool
2024-08-21 21:09:13 +00:00
# targetRepo(object $item, object $repo) : bool
# areObjectsEqual(?object $obj1, ?object $obj2) : bool
2024-07-16 12:12:10 +00:00
# getSettingsPath() : string
2024-07-20 20:42:08 +00:00
# getIndexSettingsPath() : string
# index_map_IndexName(object $item) : ?string
# index_map_IndexSettingsPath(object $item) : string
# index_map_IndexPath(object $item) : string
# index_map_IndexKey(object $item) : string
# index_map_IndexGUID(object $item) : string
2024-07-08 21:10:45 +00:00
}
2024-07-16 12:12:10 +00:00
note right of Set::__construct
2024-07-08 21:10:45 +00:00
Constructor.
since: 3.2.2
arguments:
array $repos
Grep $grep
Items $items
2024-07-16 12:12:10 +00:00
ItemReadme $itemReadme
MainReadme $mainReadme
2024-07-08 21:10:45 +00:00
Git $git
?string $table = null
2024-07-16 12:12:10 +00:00
?string $settingsPath = null
2024-07-20 20:42:08 +00:00
?string $settingsIndexPath = null
2024-07-08 21:10:45 +00:00
end note
2024-07-16 12:12:10 +00:00
note left of Set::table
2024-07-08 21:10:45 +00:00
Set the current active table
since: 3.2.2
return: self
end note
2024-07-20 20:42:08 +00:00
note right of Set::area
Set the current active area
since: 3.2.2
return: self
end note
note left of Set::setSettingsPath
2024-07-16 12:12:10 +00:00
Set the settings path
since: 3.2.2
return: self
end note
2024-07-20 20:42:08 +00:00
note right of Set::setIndexSettingsPath
Set the index settings path
2024-07-08 21:10:45 +00:00
2024-07-16 12:12:10 +00:00
since: 3.2.2
2024-07-20 20:42:08 +00:00
return: self
2024-07-08 21:10:45 +00:00
end note
2024-07-20 20:42:08 +00:00
note left of Set::items
Save items remotely
2024-07-08 21:10:45 +00:00
since: 3.2.2
2024-07-20 20:42:08 +00:00
return: bool
2024-07-08 21:10:45 +00:00
end note
2024-07-20 20:42:08 +00:00
note right of Set::updateItem
2024-07-16 12:12:10 +00:00
update an existing item (if changed)
since: 3.2.2
return: bool
arguments:
object $item
object $existing
object $repo
end note
2024-07-20 20:42:08 +00:00
note left of Set::createItem
2024-07-16 12:12:10 +00:00
create a new item
since: 3.2.2
return: void
end note
2024-07-20 20:42:08 +00:00
note right of Set::updateItemReadme
2024-07-16 12:12:10 +00:00
update an existing item readme
since: 3.2.2
return: void
arguments:
object $item
object $existing
object $repo
end note
2024-07-20 20:42:08 +00:00
note left of Set::createItemReadme
2024-07-16 12:12:10 +00:00
create a new item readme
since: 3.2.2
return: void
end note
2024-07-20 20:42:08 +00:00
note right of Set::getTable
Get the current active table
since: 3.2.2
return: string
end note
note left of Set::getArea
Get the current active area
since: 3.2.2
return: string
end note
note right of Set::saveRepoMainSettings
2024-07-16 12:12:10 +00:00
Update/Create the repo main readme and index
since: 3.2.2
return: void
end note
2024-07-20 20:42:08 +00:00
note left of Set::isInvalidIndexRepo
Validate repository and settings
2024-07-08 21:10:45 +00:00
since: 3.2.2
2024-07-20 20:42:08 +00:00
return: bool
2024-07-08 21:10:45 +00:00
end note
2024-07-20 20:42:08 +00:00
note right of Set::mergeIndexSettings
Merge current settings with new settings
since: 3.2.2
return: array
end note
note left of Set::updateIndexMainFile
Update a file in the repository
2024-07-16 12:12:10 +00:00
since: 3.2.2
return: void
2024-07-20 20:42:08 +00:00
arguments:
object $repo
string $path
string $content
string $message
2024-07-16 12:12:10 +00:00
end note
2024-07-20 20:42:08 +00:00
note right of Set::getLocalItems
Get items
since: 3.2.2
return: ?array
end note
note left of Set::mapItem
2024-07-08 21:10:45 +00:00
Map a single item to its properties
since: 3.2.2
return: object
end note
2024-07-20 20:42:08 +00:00
note right of Set::save
Save an item remotely
since: 3.2.2
return: void
end note
2024-08-21 21:09:13 +00:00
note left of Set::setRepoPlaceholders
Set the Repo Placeholders
since: 5.0.3
return: void
end note
note right of Set::updatePlaceholders
Update Placeholders in String
since: 5.0.3
return: string
end note
2024-07-20 20:42:08 +00:00
note left of Set::getIndexItem
Get index values
since: 3.2.2
return: ?array
end note
note right of Set::canWrite
2024-07-08 21:10:45 +00:00
check that we have an active repo towards which we can write data
since: 3.2.2
return: bool
end note
2024-08-21 21:09:13 +00:00
note left of Set::targetRepo
check that we have a target repo of this item
2024-07-08 21:10:45 +00:00
2024-08-21 21:09:13 +00:00
since: 5.0.3
return: bool
end note
note right of Set::areObjectsEqual
Checks if two objects are equal by comparing their properties and values.
This method converts both input objects to associative arrays, sorts the arrays by keys,
and compares these sorted arrays.
If the arrays are identical, the objects are considered equal.
since: 5.0.2
2024-07-08 21:10:45 +00:00
return: bool
end note
2024-08-21 21:09:13 +00:00
note left of Set::getSettingsPath
2024-07-16 12:12:10 +00:00
Get the settings path
2024-07-08 21:10:45 +00:00
since: 3.2.2
2024-07-16 12:12:10 +00:00
return: string
2024-07-08 21:10:45 +00:00
end note
2024-07-20 20:42:08 +00:00
2024-08-21 21:09:13 +00:00
note right of Set::getIndexSettingsPath
2024-07-20 20:42:08 +00:00
Get the index settings path
since: 3.2.2
return: string
end note
2024-08-21 21:09:13 +00:00
note left of Set::index_map_IndexName
2024-07-20 20:42:08 +00:00
Get the item name for the index values
since: 3.2.2
return: ?string
end note
2024-08-21 21:09:13 +00:00
note right of Set::index_map_IndexSettingsPath
2024-07-20 20:42:08 +00:00
Get the item settings path for the index values
since: 3.2.2
return: string
end note
2024-08-21 21:09:13 +00:00
note left of Set::index_map_IndexPath
2024-07-20 20:42:08 +00:00
Get the item path for the index values
since: 3.2.2
return: string
end note
2024-08-21 21:09:13 +00:00
note right of Set::index_map_IndexKey
2024-07-20 20:42:08 +00:00
Get the item JPK for the index values
since: 3.2.2
return: string
end note
2024-08-21 21:09:13 +00:00
note left of Set::index_map_IndexGUID
2024-07-20 20:42:08 +00:00
Get the item GUID for the index values
since: 3.2.2
return: string
end note
2024-07-08 21:10:45 +00:00
@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---eb7d69c2_4ee9_4bd0_aacc_ab51a12be895---Power
```
> remember to replace the `---` with `___` to activate this Power in your code
2024-07-08 21:10:45 +00:00
---
```
██╗ ██████╗██████╗
██║██╔════╝██╔══██╗
██║██║ ██████╔╝
██ ██║██║ ██╔══██╗
╚█████╔╝╚██████╗██████╔╝
╚════╝ ╚═════╝╚═════╝
```
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)