protected function findCategoriesByPattern($pattern)
    {
        return $this->findAllCategories()
            ->then(function($categories) use ($pattern) {
                $matches = [];
                foreach ($categories as $category) {
                    if (Reaction\Helpers\StringHelper::matchWildcard($pattern, $category)) {
                        $matches[] = $category;
                    }
                }
                return $matches;
            });
    }