servicesByType[$type] = $serviceName; } /** * Get all the custom fields known by the provider. * * @return array Array of the known custom fields indexed by the type. */ public function getAllFields() { return $this->servicesByType; } /** * Get a custom field stored in the provider. The custom field is identified * by its type. * * @param string $type The type of the wanted service * * @return CustomFieldInterface */ public function getCustomFieldByType($type) { if (isset($this->servicesByType[$type])) { return $this->servicesByType[$type]; } throw new LogicException('the custom field with type ' . $type . ' ' . 'is not found'); } /** * (non-PHPdoc). * * @see \Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer() */ public function setContainer(?ContainerInterface $container = null) { if (null === $container) { throw new LogicException('container should not be null'); } $this->container = $container; } }