private function sortWithEncryptedOrderBy($values, array $orderBy)
    {
        usort($values, function($entity1, $entity2) use ($orderBy) {
            foreach ($orderBy as $fieldName => $order) {
                $value1 = $this->getFieldValue($entity1, $fieldName);
                $value2 = $this->getFieldValue($entity2, $fieldName);

                if ($value1 < $value2) {
                    return (strtoupper($order) === 'ASC') ? -1 : 1;
                }
                elseif ($value1 > $value2) {
                    return (strtoupper($order) === 'ASC') ? 1 : -1;
                }
            }

            // If we are here is because all the values were equal
            return 0;
        });

        return $values;
    }