public function findThreaded(Query $query, array $options)
    {
        $options += [
            'keyField' => $this->getPrimaryKey(),
            'parentField' => 'parent_id',
            'nestingKey' => 'children'
        ];

        if (isset($options['idField'])) {
            $options['keyField'] = $options['idField'];
            unset($options['idField']);
            deprecationWarning('Option "idField" is deprecated, use "keyField" instead.');
        }

        $options = $this->_setFieldMatchers($options, ['keyField', 'parentField']);

        return $query->formatResults(function ($results) use ($options) {
            /** @var \Cake\Collection\CollectionInterface $results */
            return $results->nest($options['keyField'], $options['parentField'], $options['nestingKey']);
        });
    }