Refactor value handling in multiple classes for improved data processing

This commit is contained in:
2024-10-30 09:38:37 +01:00
parent 9e05750801
commit ee240f7dbd
25 changed files with 364 additions and 25 deletions

View File

@@ -32,7 +32,17 @@ class ShopCategory
static public function save()
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania kategorii wystąpił błąd. Proszę spróbować ponownie.' ];
$values = json_decode( \S::get( 'values' ), true );
$values_tmp = json_decode( \S::get( 'values' ), true );
$values = [];
foreach ( $values_tmp as $item )
{
$name = $item['name'];
$value = $item['value'];
$keys = \S::parse_name( $name );
\S::set_array_value( $values, $keys, $value );
}
if ( $id = \admin\factory\ShopCategory::save(
$values['id'], $values['title'], $values['text'], $values['text_hidden'], $values['seo_link'], $values['meta_title'], $values['meta_description'], $values['meta_keywords'], $values['parent_id'], $values['status'],