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/Models/Model.php
<?php

namespace EasingSlider\Foundation\Models;

use EasingSlider\Foundation\Contracts\Models\Model as ModelContract;

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

abstract class Model implements ModelContract
{
	/**
	 * Attributes
	 *
	 * @var array
	 */
	protected $attributes;

	/**
	 * Constructor
	 *
	 * @return void
	 */
	public function __construct()
	{
		$this->attributes = $this->getDefaults();
	}

	/**
	 * __get function.
	 *
	 * @param  string $key
	 * @return mixed
	 */
	public function __get($key)
	{
		return $this->get($key);
	}

	/**
	 * __set function.
	 *
	 * @param string $key
	 * @param mixed  $value
	 */
	public function __set($key, $value)
	{
		$this->set($key, $value);
	}

	/**
	 * __isset function.
	 *
	 * @param  string $key
	 * @return bool
	 */
	public function __isset($key)
	{
		return isset($this->attributes[$key]);
	}

	/**
	 * Fills attributes
	 *
	 * @param  array $data
	 * @return void
	 */
	public function fill($data = array())
	{
		foreach ($data as $key => $value) {
			$this->set($key, $value);
		}
	}

	/**
	 * Set an attribute value
	 *
	 * @param  string $key
	 * @param  mixed  $value
	 * @return void
	 */
	public function set($key, $value)
	{
		$this->attributes[$key] = $value;
	}

	/**
	 * Get an attribute value
	 *
	 * @param  string $key
	 * @return array
	 */
	public function get($key)
	{
		return $this->attributes[$key];
	}

	/**
	 * Gets the model attributes
	 *
	 * @return array 
	 */
	public function getAttributes()
	{
		return $this->attributes;
	}

	/**
	 * Gets the model defaults
	 *
	 * @return array
	 */
	public function getDefaults()
	{
		//
	}
}