Adds more classes, and refactoring to the search feature. Adds test search to search page. #952

This commit is contained in:
2022-09-16 23:41:41 +02:00
parent d757e14fac
commit c53ece2a2d
22 changed files with 845 additions and 91 deletions

View File

@@ -12,6 +12,8 @@
namespace VDM\Joomla\Componentbuilder\Search\Model;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Search\Interfaces\ModelInterface;
use VDM\Joomla\Componentbuilder\Search\Model;
@@ -43,7 +45,7 @@ class Get extends Model implements ModelInterface
}
// check if this is a valid table
if (($store = $this->table->get($table, $field, 'store')) !== null)
if (StringHelper::check($value) && ($store = $this->table->get($table, $field, 'store')) !== null)
{
// open the value based on the store method
switch($store)
@@ -52,7 +54,11 @@ class Get extends Model implements ModelInterface
$value = \base64_decode($value);
break;
case 'json':
$value = \json_decode($value, true);
// check if there is a json string
if (JsonHelper::check($value))
{
$value = \json_decode($value, true);
}
break;
}
}