Adds the initial classes needed for the new search feature. Adds the empty view for the search feature. #952

This commit is contained in:
2022-09-14 17:40:02 +02:00
parent 1dddba0fc8
commit d757e14fac
57 changed files with 6293 additions and 177 deletions

View File

@@ -0,0 +1,65 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Componentbuilder\Search\Interfaces;
/**
* Search Find Interface
*
* @since 3.2.0
*/
interface FindInterface
{
/**
* Get found values
*
* @param string|null $table The table being searched
*
* @return array|null
* @since 3.2.0
*/
public function get(?string $table = null): ?array;
/**
* Search over an item fields
*
* @param object $item The item object of fields to search through
* @param int|null $id The item id
* @param string|null $table The table being searched
*
* @return void
* @since 3.2.0
*/
public function item(object $item, ?int $id =null, ?string $table = null);
/**
* Search over an array of items
*
* @param array|null $items The array of items to search through
* @param string|null $table The table being searched
*
* @return void
* @since 3.2.0
*/
public function items(?array $items = null, ?string $table = null);
/**
* Reset all found values of a table
*
* @param string|null $table The table being searched
*
* @return void
* @since 3.2.0
*/
public function reset(?string $table = null);
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Componentbuilder\Search\Interfaces;
/**
* Search Database Get Interface
*
* @since 3.2.0
*/
interface GetInterface
{
/**
* Get values from a given table
* Example: $this->value(23, 'value_key', 'table_name');
*
* @param string $field The field key
* @param int $id The item ID
* @param string|null $table The table
*
* @return mixed
* @since 3.2.0
*/
public function value(string $field, int $id, string $table = null);
/**
* Get values from a given table
* Example: $this->item(23, 'table_name');
*
* @param int $id The item ID
* @param string| null $table The table
*
* @return object|null
* @since 3.2.0
*/
public function item(int $id, string $table = null): ?object;
/**
* Get values from a given table
* Example: $this->items('table_name');
*
* @param string|null $table The table
* @param int $bundle The bundle to return (0 = all)
*
* @return array|null
* @since 3.2.0
*/
public function items(string $table = null, int $bundle = 0): ?array;
}

View File

@@ -0,0 +1,71 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Componentbuilder\Search\Interfaces;
/**
* Search Model Interface
*
* @since 3.2.0
*/
interface ModelInterface
{
/**
* Model the value
* Example: $this->value(value, 'value_key', 'table_name');
*
* @param mixed $value The value to model
* @param string $field The field key
* @param string|null $table The table
*
* @return mixed
* @since 3.2.0
*/
public function value($value, string $field, ?string $table = null);
/**
* Model the values of an item
* Example: $this->item('table_name', Object);
*
* @param string $table The table
* @param object $item The item object
*
* @return object
* @since 3.2.0
*/
public function item(object $item, ?string $table = null): object;
/**
* Model the values of multiple items
* Example: $this->items(Array, 'table_name');
*
* @param array|null $items The array of item objects
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function items(?array $items = null, ?string $table = null): ?array;
/**
* Get last modeled ID
* Example: $this->last('table_name');
*
* @param string|null $table The table
*
* @return int|null
* @since 3.2.0
*/
public function last(?string $table = null): ?int;
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Componentbuilder\Search\Interfaces;
/**
* Search Replace Interface
*
* @since 3.2.0
*/
interface ReplaceInterface
{
/**
* Get updated values
*
* @param string|null $table The table being searched
*
* @return array|null
* @since 3.2.0
*/
public function get(?string $table = null): ?array;
/**
* Search over an item fields
*
* @param object $item The item object of fields to search through
* @param int|null $id The item id
* @param string|null $table The table being searched
*
* @return void
* @since 3.2.0
*/
public function item(object $item, ?int $id =null, ?string $table = null);
/**
* Search over an array of items
*
* @param array|null $items The array of items to search through
* @param string|null $table The table being searched
*
* @return void
* @since 3.2.0
*/
public function items(?array $items = null, ?string $table = null);
/**
* Reset all updated values of a table
*
* @param string|null $table The table being searched
*
* @return void
* @since 3.2.0
*/
public function reset(?string $table = null);
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @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\Componentbuilder\Search\Interfaces;
/**
* Search Database Set Interface
*
* @since 3.2.0
*/
interface SetInterface
{
/**
* Set values to a given table
* Example: $this->value(Value, 23, 'value_key', 'table_name');
*
* @param mixed $value The field value
* @param int $id The item ID
* @param string $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
public function value($value, int $id, string $field, ?string $table = null): bool;
/**
* Set values to a given table
* Example: $this->item(Object, 23, 'table_name');
*
* @param object $item The item to save
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
public function item(object $item, ?string $table = null): bool;
/**
* Set values to a given table
* Example: $this->items(Array, 'table_name');
*
* @param array $items The items being saved
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
public function items(array $items, string $table = null): bool;
}

View File

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