<?php
/**
 * @package     SP Soccer
 * @author      JoomShaper http://www.joomshaper.com
 * @copyright   Copyright (C) 2010 - 2016 JoomShaper. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die('Restricted access');

class SpsoccerViewPlayer extends FOFViewHtml{

	public function display($tpl = null){
		// Get model
		$model = $this->getModel();
		// get item
		$this->item = $model->getItem();

		//Get position info by ID
		$this->item->position 		 = $model->getPositionByID($this->item->spsoccer_possition_id)->title;
		//Get Team info by ID
		$this->item->team 			 = $model->getTeamByID($this->item->spsoccer_gameteam_id);
		$this->item->team->logo 	 = SpsoccerHelper::hasimg($this->item->team->logo);
		//Get Previous Team
		$this->item->previous_team 	 = $model->getTeamByID($this->item->previous_club);
		// this image
		$this->item->image 			 = SpsoccerHelper::hasimg($this->item->image);


		return parent::display($tpl = null);
	}
}
