final public function addSort($columnName, $ascending = true)
    {
        $parts = explode(".", $columnName);

        $sort = new Sort();

        if (count($parts) > 1) {
            $columnName = $parts[count($parts) - 1];

            $relationships = array_slice($parts, 0, count($parts) - 1);
            $newColumnName = PdoRepository::getPdoParamName($columnName);
            $intersectionCollection = $this->createIntersectionForRelationships($relationships, [$columnName => $newColumnName]);
            $sort->tableAlias = $intersectionCollection->getUniqueReference();
            $sort->alias = $newColumnName;
        } else {
            $sort->alias = $columnName;
        }

        $sort->columnName = $columnName;
        $sort->ascending = $ascending;
        $this->sorts[] = $sort;

        $this->invalidate();

        return $this;
    }