<?php

/**
 * Helper class file for audit logging.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package clearFusionCMS
 * @copyright Copyright (c) 2016 clearFusionCMS. All rights reserved.
 * @link http://clearfusioncms.com
 */

/**
 * cfSettingsAudit Class
 *
 * Static class to provide settings audit trail logging.
 *
 * @package clearFusionCMS
 */
abstract class cfSettingsAudit extends cfAudit {

	/**#@+
	 * Action codes.
	 */
	const UPDATE = 2400;
	/**#@-*/

	/**
	 * Record a setting update event.
	 *
	 * @param string $module The module holding the setting.
	 * @param string $name The name of the setting.
	 * @param array $prev The previous values.
	 */
	static function update($module, $name, $prev) {
		self::record(self::UPDATE, 'cfSettings', 0, [
			'module' => $module,
			'name' => $name
		], $prev);
	}
}
