<?php

namespace App\Reports\Sources\ImportedDocs;

class PopulateLoopRecords extends \App\Reports\Sources\PopulateLoopRecordsAbstract
{

	/**
	 * These are the standard columns that we expect are filled in during the loop records. The list
	 * may not contain anyting
	 * @var array
	 */
	protected array $processStandardColumns = [ 'impDoc_tinaDocsList' ];

	/**
	 * {@inheritDoc}
	 * @see \App\Reports\Sources\PopulateLoopRecordsAbstract::updateReportStdColumns()
	 */
	protected function updateReportStdColumns(array $currentRow) :array
	{

		// loads all the standard columns from
		$tableColumns = $this->columnsManager->getStdColumns();

		$updateColumns = [];

		if ($tableColumns['impDoc_tinaDocsList'] and $currentRow['impDoc_tinaDocsList']) {
			$updateColumns['impDoc_tinaDocsList'] = implode(',', json_decode($currentRow['impDoc_tinaDocsList']));
		}

		return $updateColumns;

	}

}