<?php
/**
 * @package     SP String
 *
 * @copyright   Copyright (C) 2010 - 2017 JoomShaper. All rights reserved.
 * @license     GNU General Public License version 2 or later.
 */

// No Direct Access
defined('_JEXEC') or die('Restricted Access');

class SpsoccerTableVanues extends FOFTable{

	public function check() {
		$result = true;
		if (is_array($this->socials)){
			if (!empty($this->socials)){
				$this->socials = json_encode($this->socials);
			}
		}
		if (is_null($this->socials) || empty($this->socials)){
			$this->socials = '';
		}

		return $result;
	}

	public function onAfterLoad(&$result) {
		if(!is_array($this->socials)) {
			if(!empty($this->socials)) {
				$this->socials = json_decode($this->socials, true);
			}
		}
		if(is_null($this->socials) || empty($this->socials)) {
			$this->socials = array();
		}

		return parent::onAfterLoad($result);
	}
}
