protected function addSorting(QueryBuilder $queryBuilder, array $sorting = [])
    {
        foreach ($sorting as $field => $sortOrder) {
            if (!$this->isFieldSortable($field)) {
                // Skip: invalid field
                continue;
            }
            if (!$this->isSortOrderValid($sortOrder)) {
                // Skip: invalid sort order
                continue;
            }

            $methodName = sprintf('add%sSorting', ucfirst($field));
            if (method_exists($this, $methodName)) {
                $this->$methodName($queryBuilder, $sortOrder);
                continue;
            }

            $queryBuilder->addOrderBy($this->addEntityAlias($field), strtolower($sortOrder));
        }

        return $queryBuilder;
    }