Esempio n. 1
0
 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');
     }
 }
Esempio n. 2
0
 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'])));
 }
Esempio n. 3
0
 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'])));
 }
Esempio n. 4
0
 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'])));
 }
Esempio n. 5
0
 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'])));
 }
Esempio n. 6
0
 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');
     }
 }