super-powers/src/8aef58c1-3f70-4bd4-b9e4-3f29fcd41cff/README.md

142 lines
4.4 KiB
Markdown
Raw Permalink Normal View History

2023-07-04 06:26:08 +00:00
```
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
```
# interface ModelInterface (Details)
2024-06-21 12:01:19 +00:00
> namespace: **VDM\Joomla\Interfaces**
2024-07-16 12:12:10 +00:00
2023-07-04 06:26:08 +00:00
```uml
@startuml
interface ModelInterface #Lavender {
2024-06-21 12:01:19 +00:00
+ table(string $table) : self
2023-07-04 06:26:08 +00:00
+ value(mixed $value, string $field, ...) : mixed
2024-09-04 23:21:47 +00:00
+ values(?array $items, string $field, ...) : ?array
2024-06-21 12:01:19 +00:00
+ item(?object $item, ?string $table = null) : ?object
2023-07-04 06:26:08 +00:00
+ items(?array $items = null, ?string $table = null) : ?array
2024-06-21 12:01:19 +00:00
+ row(?array $item, ?string $table = null) : ?array
2023-07-04 06:26:08 +00:00
+ rows(?array $items = null, ?string $table = null) : ?array
+ last(?string $table = null) : ?int
2024-06-21 12:01:19 +00:00
+ setTable(string $tableName) : void
+ setAllowEmpty(bool $allowEmpty) : void
2023-07-04 06:26:08 +00:00
}
2024-06-21 12:01:19 +00:00
note right of ModelInterface::table
Set the current active table
since: 3.2.2
return: self
end note
note left of ModelInterface::value
2023-07-04 06:26:08 +00:00
Model the value
Example: $this->value(value, 'value_key', 'table_name');
since: 3.2.0
return: mixed
arguments:
mixed $value
string $field
?string $table = null
end note
2024-06-23 20:34:48 +00:00
note right of ModelInterface::values
Model a value of multiple items
Example: $this->items(Array, 'value_key', 'table_name');
since: 3.2.0
return: ?array
arguments:
2024-09-04 23:21:47 +00:00
?array $items
2024-06-23 20:34:48 +00:00
string $field
?string $table = null
end note
note left of ModelInterface::item
2023-07-04 06:26:08 +00:00
Model the values of an item
Example: $this->item(Object, 'table_name');
since: 3.2.0
return: ?object
end note
2024-06-23 20:34:48 +00:00
note right of ModelInterface::items
2023-07-04 06:26:08 +00:00
Model the values of multiple items
Example: $this->items(Array, 'table_name');
since: 3.2.0
return: ?array
end note
2024-06-23 20:34:48 +00:00
note left of ModelInterface::row
2023-07-04 06:26:08 +00:00
Model the values of an row
Example: $this->item(Array, 'table_name');
since: 3.2.0
return: ?array
end note
2024-06-23 20:34:48 +00:00
note right of ModelInterface::rows
2023-07-04 06:26:08 +00:00
Model the values of multiple rows
Example: $this->items(Array, 'table_name');
since: 3.2.0
return: ?array
end note
2024-06-23 20:34:48 +00:00
note left of ModelInterface::last
2023-07-04 06:26:08 +00:00
Get last modeled ID
Example: $this->last('table_name');
since: 3.2.0
return: ?int
end note
2024-06-21 12:01:19 +00:00
2024-06-23 20:34:48 +00:00
note right of ModelInterface::setTable
2024-06-21 12:01:19 +00:00
Set the current active table
since: 3.2.2
return: void
end note
2024-06-23 20:34:48 +00:00
note left of ModelInterface::setAllowEmpty
2024-06-21 12:01:19 +00:00
Set the switch to control the behaviour of empty values
since: 3.2.2
return: void
end note
2023-07-04 06:26:08 +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---8aef58c1_3f70_4bd4_b9e4_3f29fcd41cff---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)