4
0

update 2023-06-05 00:30:52

This commit is contained in:
Robot 2023-06-05 00:30:52 +02:00
parent a03abafafd
commit c83c2b8549
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
4 changed files with 13 additions and 43 deletions

View File

@ -71,7 +71,7 @@ note right of Upsert::getTable
end note
note right of Upsert::modelDistributionHistory
Model Translation History
Model Distribution History
since: 2.0.1
return: mixed

View File

@ -14,8 +14,6 @@ namespace VDM\Joomla\GetBible\Model;
use VDM\Joomla\GetBible\Config;
use VDM\Joomla\GetBible\Table;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Interfaces\ModelInterface;
use VDM\Joomla\Abstraction\Model;
@ -73,7 +71,7 @@ final class Upsert extends Model implements ModelInterface
// check if this is a valid table
if (($store = $this->table->get($table, $field, 'store')) !== null)
{
// Model Translation History
// Model Distribution History
if ($table === 'translation' && $field === 'distribution_history')
{
$value = $this->modelDistributionHistory($value);
@ -103,13 +101,8 @@ final class Upsert extends Model implements ModelInterface
*/
protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool
{
// check values
if (StringHelper::check($value) || ArrayHelper::check($value, true) || ObjectHelper::check($value) || is_numeric($value))
{
return true;
}
// remove empty values
return false;
// add all values
return true;
}
/**
@ -124,13 +117,8 @@ final class Upsert extends Model implements ModelInterface
*/
protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool
{
// only strings or numbers allowed
if (StringHelper::check($value) || is_numeric($value))
{
return true;
}
// remove empty values
return false;
// add all values
return true;
}
/**
@ -145,7 +133,7 @@ final class Upsert extends Model implements ModelInterface
}
/**
* Model Translation History
* Model Distribution History
*
* @param mixed $value The value to model
*

View File

@ -43,7 +43,7 @@
// check if this is a valid table
if (($store = $this->table->get($table, $field, 'store')) !== null)
{
// Model Translation History
// Model Distribution History
if ($table === 'translation' && $field === 'distribution_history')
{
$value = $this->modelDistributionHistory($value);
@ -73,13 +73,8 @@
*/
protected function validateBefore(&$value, ?string $field = null, ?string $table = null): bool
{
// check values
if (StringHelper::check($value) || ArrayHelper::check($value, true) || ObjectHelper::check($value) || is_numeric($value))
{
return true;
}
// remove empty values
return false;
// add all values
return true;
}
/**
@ -94,13 +89,8 @@
*/
protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool
{
// only strings or numbers allowed
if (StringHelper::check($value) || is_numeric($value))
{
return true;
}
// remove empty values
return false;
// add all values
return true;
}
/**
@ -115,7 +105,7 @@
}
/**
* Model Translation History
* Model Distribution History
*
* @param mixed $value The value to model
*

View File

@ -20,14 +20,6 @@
"use": "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068",
"as": "default"
},
"use_selection2": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
},
"use_selection3": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
},
"use_selection4": {
"use": "91004529-94a9-4590-b842-e7c6b624ecf5",
"as": "default"