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); }