Release of v4.0.1-alpha5

Add repositories for better integration with gitea. Refactored the Data classes. Add new Data classes.
This commit is contained in:
2024-06-21 01:37:13 +02:00
parent f36922f9a1
commit 5a2e137f31
120 changed files with 8945 additions and 3699 deletions

View File

@@ -0,0 +1,60 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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\Interfaces\Data;
/**
* Data Delete
*
* @since 3.2.2
*/
interface DeleteInterface
{
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self;
/**
* Delete all items in the database that match these conditions
*
* @param array $conditions Conditions by which to delete the data in database [array of arrays (key => value)]
*
* @return bool
* @since 3.2.2
**/
public function items(array $conditions): bool;
/**
* Truncate a table
*
* @param string|null $table The table that should be truncated
*
* @return void
* @since 3.2.2
**/
public function truncate(): void;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,98 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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\Interfaces\Data;
/**
* Data Insert
*
* @since 3.2.2
*/
interface InsertInterface
{
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self;
/**
* 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;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,86 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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\Interfaces\Data;
/**
* Data Item Interface
*
* @since 3.2.2
*/
interface ItemInterface
{
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self;
/**
* Get an item
*
* @param string $value The item key value
* @param string $key The item key
*
* @return object|null The item object or null
* @since 3.2.2
*/
public function get(string $value, string $key = 'guid'): ?object;
/**
* Get the value
*
* @param string $value The item key value
* @param string $key The item key
* @param string $get The key of the values we want back
*
* @return mixed
* @since 3.2.2
*/
public function value(string $value, string $key = 'guid', string $get = 'id');
/**
* Set an item
*
* @param object $item The item
* @param string $key The item key
* @param string|null $action The action to load power
*
* @return bool
* @since 3.2.2
*/
public function set(object $item, string $key = 'guid', ?string $action = null): bool;
/**
* Delete an item
*
* @param string $value The item key value
* @param string $key The item key
*
* @return bool
* @since 3.2.2
*/
public function delete(string $value, string $key = 'guid'): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,85 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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\Interfaces\Data;
/**
* Data Items Interface
*
* @since 3.2.2
*/
interface ItemsInterface
{
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self;
/**
* Get list of items
*
* @param array $values The ids of the items
* @param string $key The key of the values
*
* @return array|null The item object or null
* @since 3.2.2
*/
public function get(array $values, string $key = 'guid'): ?array;
/**
* Get the values
*
* @param array $values The list of values (to search by).
* @param string $key The key on which the values being searched.
* @param string $get The key of the values we want back
*
* @return array|null The array of found values.
* @since 3.2.2
*/
public function values(array $values, string $key = 'guid', string $get = 'id'): ?array;
/**
* Set items
*
* @param array $items The list of items
* @param string $key The key on which the items should be set
*
* @return bool
* @since 3.2.2
*/
public function set(array $items, string $key = 'guid'): bool;
/**
* Delete items
*
* @param array $values The item key value
* @param string $key The item key
*
* @return bool
* @since 3.2.2
*/
public function delete(string $values, string $key = 'guid'): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,90 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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\Interfaces\Data;
/**
* Data Load Interface
*
* @since 3.2.2
*/
interface LoadInterface
{
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self;
/**
* 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
*
* @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
*
* @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($keys);
*
* @param array $keys The item keys
*
* @return array|null
* @since 2.0.1
*/
public function items(array $keys): ?array;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,69 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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\Interfaces\Data;
/**
* Load data based on global unique ids from remote system
*
* @since 3.2.2
*/
interface RemoteInterface
{
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self;
/**
* Init all items not found in database
*
* @return bool
* @since 3.2.0
*/
public function init(): bool;
/**
* Reset the items
*
* @param array $items The global unique ids of the items
*
* @return bool
* @since 3.2.0
*/
public function reset(array $items): bool;
/**
* Load a item
*
* @param string $guid The global unique id of the item
* @param array $order The search order
*
* @return bool
* @since 3.2.2
*/
public function load(string $guid, array $order = ['remote', 'local']): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1,102 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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\Interfaces\Data;
/**
* Data Update
*
* @since 3.2.2
*/
interface UpdateInterface
{
/**
* Set the current active table
*
* @param string|null $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(?string $table): self;
/**
* 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
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function row(array $item, string $key = 'guid'): bool;
/**
* Update multiple rows to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of arrays)
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function rows(?array $items, string $key = 'guid'): bool;
/**
* Update single item with multiple values to a given table
* Example: $this->item(Object);
*
* @param object $item The item to save
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function item(object $item, string $key = 'guid'): bool;
/**
* Update multiple items to a given table
* Example: $this->items(Array);
*
* @param array|null $items The items updated in database (array of objects)
* @param string $key The key name
*
* @return bool
* @since 3.2.0
*/
public function items(?array $items, string $key = 'guid'): bool;
/**
* Get the current active table
*
* @return string
* @since 3.2.2
*/
public function getTable(): string;
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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\Interfaces;
/**
* Database Delete Interface
*
* @since 3.2.0
*/
interface DeleteInterface
{
/**
* Delete all rows in the database that match these conditions
*
* @param array $conditions Conditions by which to delete the data in database [array of arrays (key => value)]
* @param string $table The table where the data is being deleted
*
* @return bool
* @since 3.2.0
**/
public function items(array $conditions, string $table): bool;
/**
* Truncate a table
*
* @param string $table The table that should be truncated
*
* @return void
* @since 3.2.2
**/
public function truncate(string $table): void;
}

View File

@@ -19,6 +19,16 @@ namespace VDM\Joomla\Interfaces;
*/
interface ModelInterface
{
/**
* Set the current active table
*
* @param string $table The table that should be active
*
* @return self
* @since 3.2.2
*/
public function table(string $table): self;
/**
* Model the value
* Example: $this->value(value, 'value_key', 'table_name');
@@ -36,13 +46,13 @@ interface ModelInterface
* Model the values of an item
* Example: $this->item(Object, 'table_name');
*
* @param object $item The item object
* @param object|null $item The item object
* @param string|null $table The table
*
* @return object|null
* @since 3.2.0
*/
public function item(object $item, ?string $table = null): ?object;
public function item(?object $item, ?string $table = null): ?object;
/**
* Model the values of multiple items
@@ -60,13 +70,13 @@ interface ModelInterface
* Model the values of an row
* Example: $this->item(Array, 'table_name');
*
* @param array $item The item array
* @param array|null $item The item array
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function row(array $item, ?string $table = null): ?array;
public function row(?array $item, ?string $table = null): ?array;
/**
* Model the values of multiple rows
@@ -89,6 +99,26 @@ interface ModelInterface
* @return int|null
* @since 3.2.0
*/
public function last(?string $table = null): ?int;
public function last(?string $table = null): ?int;
/**
* Set the current active table
*
* @param string $tableName The table name
*
* @return void
* @since 3.2.2
*/
public function setTable(string $tableName): void;
/**
* Set the switch to control the behaviour of empty values
*
* @param bool $allowEmpty The switch
*
* @return void
* @since 3.2.2
*/
public function setAllowEmpty(bool $allowEmpty): void;
}