Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

JCB! Power

final class Items (Details)

namespace: VDM\Joomla\Data

@startuml

class Items << (F,LightGreen) >> #RoyalBlue {
  # Load $load
  # Insert $insert
  # Update $update
  # Delete $delete
  # Database $database
  # string $table
  + __construct(Load $load, Insert $insert, ...)
  + ids() : array
  + table(string $table) : self
  + get(array $values, string $key = 'guid') : ?array
  + values(array $values, string $key = 'guid', ...) : ?array
  + set(array $items, string $key = 'guid') : bool
  + delete(array $values, string $key = 'guid') : bool
  + getTable() : string
  - insert(array $items) : bool
  - update(array $items, string $key) : bool
  - sort(array $items, string $key) : ?array
  - extractValues(array $items, string $key) : ?array
  - extractSet(array $items, array $set, ...) : ?array
  - normalizeGuid(array $item) : array
  # checkGuid(string $guid, string $key) : string
}

note right of Items::__construct
  Constructor.

  since: 3.2.2
  
  arguments:
    Load $load
    Insert $insert
    Update $update
    Delete $delete
    Database $database
    ?string $table = null
end note

note left of Items::ids
  Get the IDs affected by the most recent actions batch.
This method returns the complete set of entity IDs affected by the most
recent persistence operations, regardless of whether the underlying
action was an INSERT, UPDATE, or a mixture of both.
Behavioral notes:
- IDs from INSERT and UPDATE operations are merged into a single set.
- The internal ID buckets for both operations are reset immediately
after retrieval to prevent cross-contamination between batches.
- Duplicate IDs are removed while preserving their original order.
- The returned IDs represent *all* entities affected during the
most recent execution cycle.

  since: 5.1.4
  return: array
end note

note right of Items::table
  Set the current active table

  since: 3.2.2
  return: self
end note

note left of Items::get
  Get list of items

  since: 3.2.2
  return: ?array
end note

note right of Items::values
  Get the values

  since: 3.2.2
  return: ?array
  
  arguments:
    array $values
    string $key = 'guid'
    string $get = 'id'
end note

note left of Items::set
  Set items

  since: 3.2.2
  return: bool
end note

note right of Items::delete
  Delete items

  since: 3.2.2
  return: bool
end note

note left of Items::getTable
  Get the current active table

  since: 3.2.2
  return: string
end note

note right of Items::insert
  Insert a item

  since: 3.2.2
  return: bool
end note

note left of Items::update
  Update a item

  since: 3.2.2
  return: bool
end note

note right of Items::sort
  Sort items between insert and update.

  since: 3.2.2
  return: ?array
end note

note left of Items::extractValues
  Extracts values for a given key from an array of items.
Items can be either arrays or objects.

  since: 3.2.2
  return: ?array
end note

note right of Items::extractSet
  Extracts items from an array of items based on a set.
Items can be either arrays or objects.

  since: 3.2.2
  return: ?array
  
  arguments:
    array $items
    array $set
    string $key
    bool $inverse = false
end note

note left of Items::normalizeGuid
  Normalize the row item

  since: 5.1.2
  return: array
end note

note right of Items::checkGuid
  Checks if the GUID value is unique and does not already exist.

  since: 5.0.2
  return: string
end note

@enduml

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 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 maintainability.

To add this specific Power to your project in JCB:

Simply use this SPK:

Super---21bca8a4_5b28_41c4_843e_8097f0ba7cca---Power

Remember to replace the --- with ___ to activate this Power in your code.


Joomla Volunteer Portal Octoleo Llewellyn Telegram Mastodon X (Twitter) GitHub YouTube n8n Docker Hub Open Collective GPG Key