<?php
namespace Modules\Orders\MiceProjects\Types;

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();
		//\DB::debug();

		$listObj = new \App\EntityList\MiceProjectTypes();
		$listObj->setColumns(['name', 'addTime', 'idAddUser']);

		// FILTERS ////////////////////////////////////////////////////////////////////////////////
		if ($filters['name']) {
			$listObj->setFilter('name', 'LIKE', "%{$filters['name']}%");
		}

		$listObj = $this->entityList_inheritListingParams($listingParams, $listObj);

		$this->recordsList = $listObj->exportRecords();
		$this->totalRecordsCount = $listObj->getRecordsCount();
	}
}