<?php
namespace Modules\Admin\Config\OAuth2\AuthCodes; 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\OAuth2AuthCodes(); $listObj->setColumns(['authCodes.codeId', 'authCodes.clientId', 'authCodes.idUser', 'authCodes.scopes', 'authCodes.redirectUri', 'authCodes.expiresAt', 'authCodes.isRevoked', 'authCodes.addTime', 'clients.name'=>'clientName', ]); if ($filters['codeId']) { $listObj->setFilter('authCodes.codeId', '=', $filters['codeId']); } if ($filters['clientId']) { $listObj->setFilter('authCodes.clientId', '=', $filters['clientId']); } if ($filters['idUser']['id']) { $listObj->setFilter('authCodes.idUser', '=', $filters['idUser']['id']); } if ($filters['status']) { $listObj->setFilter('authCodes.isRevoked', '=', $filters['status']=='revoked'?1:0); } $listObj = $this->entityList_inheritListingParams($listingParams, $listObj); $this->recordsList = $listObj->exportRecords(); $this->totalRecordsCount = $listObj->getRecordsCount(); } } 