<?php

namespace Modules\TaskManagement\OperationTypes;

class Model extends \App\Mvc\Model_ListingAbstract
{

	/**
	 * (non-PHPdoc)
	 * @see \App\Mvc\Model_ListingAbstract::list_execute()
	 */
	public function list_execute(\App\Mvc\View\Listing\Members\Params $listingParams)
	{
		$filters = $listingParams->getFilters();

		// get the operation types list
		$listObj = new \App\EntityList\TaskOperationTypes();
		$listObj->setColumns(['description', 'idAddUser', 'addTime']);
		if ($filters['text']) {
			$listObj->setFilter('description', 'LIKE', "%{$filters['text']}%");
		}
		$listObj = $this->entityList_inheritListingParams($listingParams, $listObj);

		// these must be called in this specific order
		$this->recordsList = $listObj->exportRecords();
		$this->totalRecordsCount = $listObj->getRecordsCount();
	}

}
