public function get($userId) { $user = $this->userTable->get($userId, Fields::blacklist(['password'])); if (!empty($user)) { return $user; } else { throw new StatusCode\NotFoundException('Could not find user'); } }
public function getAll($userId, $startIndex = 0, $search = null) { $condition = new Condition(); $condition->equals('userId', $userId); $condition->equals('status', Table\App::STATUS_ACTIVE); if (!empty($search)) { $condition->like('name', '%' . $search . '%'); } return new ResultSet($this->appTable->getCount($condition), $startIndex, 16, $this->appTable->getAll($startIndex, 16, 'id', Sql::SORT_DESC, $condition, Fields::blacklist(['url', 'parameters', 'appSecret']))); }
public function getAll($startIndex = 0, $search = null, $routeId = null) { $condition = new Condition(); if (!empty($search)) { $condition->like('name', '%' . $search . '%'); } if (!empty($routeId)) { $sql = 'SELECT actionId FROM fusio_routes_action WHERE routeId = ?'; $condition->raw('id IN (' . $sql . ')', [$routeId]); } return new ResultSet($this->actionTable->getCount($condition), $startIndex, 16, $this->actionTable->getAll($startIndex, 16, 'id', Sql::SORT_DESC, $condition, Fields::blacklist(['class', 'config']))); }
public function getAll($startIndex = 0, $search = null) { $condition = !empty($search) ? new Condition(['name', 'LIKE', '%' . $search . '%']) : null; return new ResultSet($this->connectionTable->getCount($condition), $startIndex, 16, $this->connectionTable->getAll($startIndex, 16, 'id', Sql::SORT_DESC, $condition, Fields::blacklist(['class', 'config']))); }
public function getAll($startIndex = null, QueryFilter $filter) { $condition = $filter->getCondition(); return new ResultSet($this->logTable->getCount($condition), $startIndex, 16, $this->logTable->getAll($startIndex, 16, 'id', Sql::SORT_DESC, $condition, Fields::blacklist(['header', 'body']))); }
public function getPublic($appKey, $scope) { $condition = new Condition(); $condition->equals('appKey', $appKey); $condition->equals('status', Table\App::STATUS_ACTIVE); $app = $this->appTable->getOneBy($condition, Fields::blacklist(['userId', 'status', 'parameters', 'appKey', 'appSecret', 'date'])); if (!empty($app)) { $app['scopes'] = $this->appScopeTable->getByApp($app['id'], $scope, ['backend']); return $app; } else { throw new StatusCode\NotFoundException('Could not find app'); } }