public function getAll($startIndex = 0, $search = null) { $condition = new Condition(); $condition->notEquals('status', Table\User::STATUS_DELETED); if (!empty($search)) { $condition->like('name', '%' . $search . '%'); } return new ResultSet($this->userTable->getCount($condition), $startIndex, 16, $this->userTable->getAll($startIndex, 16, 'id', Sql::SORT_DESC, $condition, Fields::blacklist(['password']))); }
public function getAll($startIndex = 0, $search = null) { $condition = new Condition(); $condition->in('status', [Table\Rate::STATUS_ACTIVE]); if (!empty($search)) { $condition->like('name', '%' . $search . '%'); } return new ResultSet($this->rateTable->getCount($condition), $startIndex, 16, $this->rateTable->getAll($startIndex, 16, 'priority', Sql::SORT_DESC, $condition)); }
public function getAll($startIndex = 0, $search = null) { $condition = new Condition(); $condition->in('status', [Table\App::STATUS_ACTIVE, Table\App::STATUS_PENDING]); 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 getValue($name) { $condition = new Condition(); $condition->like('name', $name); $config = $this->configTable->getOneBy($condition); if (!empty($config)) { return $this->convertValueToType($config['value'], $config['type']); } else { return null; } }
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 getRoutes($startIndex = 0, $search = null) { $condition = new Condition(); $condition->equals('status', self::STATUS_ACTIVE); $condition->notLike('path', '/backend%'); $condition->notLike('path', '/consumer%'); $condition->notLike('path', '/doc%'); $condition->notLike('path', '/authorization%'); $condition->notLike('path', '/export%'); if (!empty($search)) { $condition->like('path', '%' . $search . '%'); } $definition = ['totalResults' => $this->getCount($condition), 'startIndex' => $startIndex, 'itemsPerPage' => 16, 'entry' => $this->doCollection([$this, 'getAll'], [$startIndex, 16, null, Sql::SORT_DESC, $condition], ['id' => 'id', 'status' => 'status', 'path' => 'path', 'controller' => 'controller'])]; return $this->build($definition); }
/** * Returns the GET response * * @param \PSX\Api\Version $version * @return array|\PSX\Data\RecordInterface */ protected function doGet(Version $version) { $startIndex = $this->getParameter('startIndex', Validate::TYPE_INTEGER) ?: 0; $search = $this->getParameter('search', Validate::TYPE_STRING) ?: null; $routeId = $this->getParameter('routeId', Validate::TYPE_INTEGER) ?: 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]); } $table = $this->tableManager->getTable('Fusio\\Impl\\Backend\\Table\\Action'); $table->setRestrictedFields(['class', 'config']); return array('totalItems' => $table->getCount($condition), 'startIndex' => $startIndex, 'entry' => $table->getAll($startIndex, null, 'id', Sql::SORT_DESC, $condition)); }
public function getCondition($alias = null) { $alias = $alias !== null ? $alias . '.' : ''; $condition = new Condition(); $condition->greaterThen($alias . 'date', $this->from->format('Y-m-d 00:00:00')); $condition->lowerThen($alias . 'date', $this->to->format('Y-m-d 23:59:59')); if (!empty($this->appId)) { $condition->equals($alias . 'appId', $this->appId); } if (!empty($this->routeId)) { $condition->equals($alias . 'routeId', $this->routeId); } if (!empty($this->ip)) { $condition->like($alias . 'ip', $this->ip); } if (!empty($this->userAgent)) { $condition->like($alias . 'userAgent', '%' . $this->userAgent . '%'); } if (!empty($this->method)) { $condition->equals($alias . 'method', $this->method); } if (!empty($this->path)) { $condition->like($alias . 'path', $this->path . '%'); } if (!empty($this->header)) { $condition->like($alias . 'header', '%' . $this->header . '%'); } if (!empty($this->body)) { $condition->like($alias . 'body', '%' . $this->body . '%'); } return $condition; }