<?php

namespace App\Reports\Sources\UsersVisits;

class PopulateQuickColumns extends \App\Reports\Sources\PopulateAbstract
{

	public function populate() :void
	{

		// INTIS //////////////////////////////////////////////////////////////////////////////////

		$reportTable = $this->tableManager->getTableName();

		$activeColumns = array_keys( $this->columnsManager->getStdColumns() );

		global $DBTRd_offices, $DBTRd_departments;

		// ADD EXTRA INFOS (FIELDS) TO THE REPORT / APPLY EXTRA FILTERS ///////////////////////////

		$this->reportGenerationStatusUpdate('extractMainDataFromDb', 'updateExtraDetails', 0);

		// get user office info
		$reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $activeColumns);
		$reportCopyInfo->populateSimple($DBTRd_offices, 'userOfficeName', 'userOfficeId', "name");

		// get user department info
		$reportCopyInfo = new \App\Reports\Db\ManageRecords\UpdateSimple($reportTable, $activeColumns);
		$reportCopyInfo->populateSimple($DBTRd_departments, 'userDepartmentName', 'userDepartmentId', "name");

	}

}
