<?php

namespace App\ReportsData\EntityFields;

class Station extends \App\ReportsData\EntityFields\GeneralAbstract
{

	/**
	 * The name of the PK column name for the current entity - usually 'id'.
	 * @var string
	 */
	protected $pkColumnName = 'code';

	/**
	 * Returns the table name that will store the current entity queue.
	 * @return string
	 */
	protected function getDbTableName()
	{
		global $DBTRd_stations;
		return $DBTRd_stations;
	}

	/**
	 * {@inheritDoc}
	 * @see \App\ReportsData\EntityFields\GeneralAbstract::getCustomValues()
	 */
	protected function getCustomValues($fieldName)
	{
		switch ($fieldName) {
			case 'country':
				return new Country($this->values['countryCode']);
			case 'city':
				return new City($this->values['cityId']);

			default:
				return parent::getCustomValues($fieldName);
		}

	}

}
