<?php
namespace Modules\Admin\Config\ImportedOrders\SystemManagement; class Model extends \App\Mvc\Model_ListingAbstract { public function list_execute(\App\Mvc\View\Listing\Members\Params $listingParams) { $filters = $listingParams->getFilters(); $listObj = new \App\EntityList\ImportedOrdersSystems(); $listObj->setColumns(['code', 'name', 'active', 'type', 'url', 'addTime']); if ($filters['name']) { $listObj->setFilter('name', 'LIKE', "%{$filters['name']}%"); } if ($filters['code']) { $listObj->setFilter('code', '=', $filters['code']); } if ($filters['type']) { $listObj->setFilter('type', '=', $filters['type']); } if ($filters['active'] == 'active') { $listObj->setFilter('active', '=', '1'); } elseif ($filters['active'] == 'inactive') { $listObj->setFilter('active', '=', '0'); } $listObj = $this->entityList_inheritListingParams($listingParams, $listObj); $this->recordsList = $listObj->exportRecords(); $this->totalRecordsCount = $listObj->getRecordsCount(); } public function getSystemTypes() { $typesList = new \Modules\Admin\Config\ImportedOrders\SystemManagement\Systems\TypesList(); \Engine\Plugins\Manager::getInstance()->executeEvent('Modules\Admin\Config\ImportedOrders\SystemManagement-getSystemTypes', ['typesList'=>$typesList]); return $typesList->getAll(); } }