<?php

namespace App\ReportsData\Populate\Entity;

class ImportedOrderSystem extends \App\ReportsData\Populate\GeneralAbstract
{

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


	/**
	 * {@inheritDoc}
	 * @see \App\ReportsData\Populate\GeneralAbstract::getEntityFields()
	 */
	protected function getEntityFields()
	{

		// get current entity details
		$entity = \Entity\ExtResSystem::select($this->id);

		// for non existing rows - return null
		if (!$entity->recordExists()) {
			return null;
		}

		// populate the entity details
		$return = [
			'id'				=> $this->id,
			'deleted'			=> $entity->deleted,
			'active'			=> $entity->active,
			'code'				=> $entity->code,
			'name'				=> $entity->name,
		];

		return $return;
	}

}
