HEX
Server: Apache
System: Linux webm004.cluster121.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: grainesdfo (155059)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/grainesdfo/www/wp-content/plugins/easing-slider/src/Foundation/Options/Option.php
<?php

namespace EasingSlider\Foundation\Options;

use EasingSlider\Foundation\Contracts\Options\Option as OptionContract;

/**
 * Exit if accessed directly
 */
if ( ! defined('ABSPATH')) {
	exit;
}

abstract class Option implements OptionContract
{
	/**
	 * Name
	 *
	 * @var string
	 */
	protected $name;

	/**
	 * Value
	 *
	 * @var mixed
	 */
	public $value;

	/**
	 * Constructor
	 *
	 * @return void
	 */
	public function __construct()
	{
		$this->value = $this->getValue();

		add_option($this->name, $this->getDefaults());
	}

	/**
	 * Gets the option name
	 *
	 * @return string
	 */
	public function getName()
	{
		return $this->name;
	}

	/**
	 * Gets the option value
	 *
	 * @return mixed
	 */
	public function getValue()
	{
		return get_option($this->name, $this->getDefaults());
	}

	/**
	 * Sets the option value
	 *
	 * @param  mixed $value
	 * @return void
	 */
	public function setValue($value)
	{
		$this->value = $value;
	}

	/**
	 * Saves the option
	 *
	 * @return viod
	 */
	public function save()
	{
		update_option($this->name, $this->value);
	}

	/**
	 * Deletes the option
	 *
	 * @return void
	 */
	public function delete()
	{
		delete_option($this->name);
	}

	/**
	 * Gets the default settings
	 *
	 * @return mixed
	 */
	public function getDefaults()
	{
		//
	}
}