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