<?php
namespace Modules\Admin\Config\ClientInvoices\CopyInvoiceRemarksFromService;

/**
 * Model class for listing forms of payment for client invoices.
 * @author adrian.voicu
 */
class Model extends \App\Mvc\Model_ListingAbstract
{

	public function list_execute(\App\Mvc\View\Listing\Members\Params $listingParams)
	{
		$list = [];

		foreach (\App\Config\CopyInvoiceRemarksFromService::getAdmin()->getAll() as $id=>$rule) {
			$list[$id] = [
				'id' =>						$id,
				'serviceRemarkVars' => 		$rule['serviceRemarkVars'],
				'invoiceRemarkFormat' => 	$rule['invoiceRemarkFormat'],
			];
		}

		$this->totalRecordsCount = count($list);
		$this->recordsList = $list;
	}
}