public function beforeFind(Event $event, Query $query, ArrayObject $options, $primary)
    {
        $query->formatResults(function ($results) {
            return $results->map(function ($revision) {
                try {
                    if (isset($revision->data->content_type_id)) {
                        $contentType = TableRegistry::get('Content.ContentTypes')
                            ->find()
                            ->where(['id' => $revision->data->content_type_id])
                            ->first();
                        $revision->data->set('content_type', $contentType);
                    }
                } catch (\Exception $e) {
                    $revision->data->set('content_type', false);
                }

                return $revision;
            });
        });

        return $query;
    }