protected function _sortParameter($sortFields, Subject $subject, $options)
    {
        if (is_string($sortFields)) {
            $sortFields = explode(',', $sortFields);
        }
        $sortFields = array_filter((array)$sortFields);

        $order = [];
        $includes = $this->getConfig('include');
        $repository = $subject->query->getRepository();
        foreach ($sortFields as $sortField) {
            $direction = 'ASC';
            if ($sortField[0] == '-') {
                $direction = 'DESC';
                $sortField = substr($sortField, 1);
            }

            if (strpos($sortField, '.') !== false) {
                list ($include, $field) = explode('.', $sortField);

                if ($include === Inflector::tableize($repository->getAlias())) {
                    $order[$repository->aliasField($field)] = $direction;
                    continue;
                }

                if (!in_array($include, $includes)) {
                    continue;
                }

                $associations = $repository->associations();
                foreach ($associations as $association) {
                    if ($association->getProperty() !== $include) {
                        continue;
                    }
                    $subject->query->contain([
                        $association->getAlias() => [
                            'sort' => [
                                $association->aliasField($field) => $direction,
                            ],
                            'strategy' => 'select',
                        ]
                    ]);
                    $subject->query->leftJoinWith($association->getAlias());

                    $order[$association->aliasField($field)] = $direction;
                }
                continue;
            } else {
                $order[$repository->aliasField($sortField)] = $direction;
            }
        }
        $subject->query->order($order);
    }