public function onProjectList(ShowProjectsEvent $projects) { $loaders = $this->extensionPoints->findImplementations(CoreExtensions::MEMBERSHIP_LOADER, new ExtensionPointFilter()); $user = $this->tokenStorage->getToken()->getUser(); foreach ($loaders as $loader) { foreach ($loader->loadProjectRepresentations($user) as $proj) { $projects->addProject($proj); } } }
public function createEditor(FormBuilderInterface $builder, ExtensionPointsInterface $extensionPoints, ExtensionPointFilter $filter) { switch ($this->type) { case self::TYPE_STRING: $builder->add($this->key, TextType::class, array('label' => $this->name)); break; case self::TYPE_INTEGER: $builder->add($this->key, IntegerType::class, array('label' => $this->name)); break; case self::TYPE_BOOLEAN: $builder->add($this->key, BooleanType::class, array('label' => $this->name)); break; case self::TYPE_EXTENSION_POINT: $builder->add($this->key, ChoiceType::class, array('label' => $this->name, 'choices' => $extensionPoints->describeImplementations($this->extensionPoint, $filter))); break; } }