HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/ebrucolor.com/wp-content/plugins/backup/src/JetBackup/Settings/Settings.php
<?php

namespace JetBackup\Settings;

use JetBackup\Config\System;
use JetBackup\Data\DBObject;
use JetBackup\Data\ReflectionObject;
use JetBackup\Exception\DBException;
use JetBackup\Exception\FieldsValidationException;
use JetBackup\Exception\IOException;
use JetBackup\Factory;
use JetBackup\JetBackup;
use ReflectionException;
use SleekDB\Exceptions\InvalidArgumentException;

if (!defined( '__JETBACKUP__')) die('Direct access is not allowed');

abstract class Settings extends DBObject {

	const COLLECTION = 'settings';

	/**
	 * @param string $section
	 *
	 * @throws DBException
	 * @throws \SleekDB\Exceptions\IOException
	 * @throws InvalidArgumentException
	 */
	public function __construct(string $section) {
		parent::__construct(self::COLLECTION);
		$this->_load([ ['_setting_id', '=', $section] ]);
		$this->set('_setting_id', $section);
	}

	public static function getChangedFields(array $current, array $original):array {
		return array_keys(array_filter($current, function($value, $key) use ($original) {
			return !array_key_exists($key, $original) || $original[$key] !== $value;
		}, ARRAY_FILTER_USE_BOTH));
	}

}