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