public function up(EventEmitterInterface $globalEmitter) { $this->profileService->getEventEmitter()->on(ProfileService::EVENT_PROFILE_CREATED, function (Profile $profile) { $collection = $this->collectionService->createCollection(new CreateCollectionParameters(sprintf('profile:%d', $profile->getId()), 'Профиль', ''), true); $this->collectionService->mainCollection($collection->getId()); }); }