Use label from formOptions or use translation or automatically create human readable one

@param FamilyInterface $family
@param array           $groupPath
@param int             $level

@throws \InvalidArgumentException

@return string
511311
protected function getGroupLabel(FamilyInterface $family, array $groupPath, $level)
    {
        $fallBack = isset($groupPath[$level]) ? $groupPath[$level] : null;
        $fieldsetPath = $this->getFieldsetPath($groupPath, $level);
        $transKeys = [
            "eav.family.{$family->getCode()}.group.{$fieldsetPath}.label",
            "eav.group.{$fieldsetPath}.label",
        ];

        return ucfirst($this->tryTranslate($transKeys, [], $fallBack));
    }
510757
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add(
            'family',
            FamilySelectorType::class,
            [
                'label' => false,
                'families' => $options['allowed_families'],
                'placeholder' => 'sidus.family.selector.placeholder',
            ]
        );
        $builder->addEventListener(
            FormEvents::PRE_SET_DATA,
            function (FormEvent $event) use ($options) {
                $form = $event->getForm();
                /** @var DataInterface $data */
                $data = $event->getData();

                /** @var FamilyInterface[] $families */
                $families = $options['allowed_families'];
                foreach ($families as $family) {
                    $selected = false;
                    if ($data instanceof DataInterface) {
                        $selected = $family->getCode() === $data->getFamilyCode();
                    }
                    $form->add(
                        'data_'.$family->getCode(),
                        AutocompleteDataSelectorType::class,
                        [
                            'label' => false,
                            'allowed_families' => [$family],
                            'auto_init' => $selected,
                            'attr' => [
                                'data-family' => $family->getCode(),
                                'style' => 'display:none',
                            ],
                        ]
                    );
                }
            }
        );

        $builder->addModelTransformer(
            new CallbackTransformer(
                function ($originalData) {
                    if ($originalData instanceof DataInterface) {
                        return [
                            'family' => $originalData->getFamily(),
                            'data_'.$originalData->getFamilyCode() => $originalData,
                        ];
                    }

                    return $originalData;
                },
                function ($submittedData) {
                    $family = $submittedData['family'];
                    if ($family instanceof FamilyInterface) {
                        return $submittedData['data_'.$family->getCode()];
                    }

                    return null;
                }
            )
        );
    }
506314
public function getInstance(FamilyInterface $family)
    {
        if (!$family->isSingleton()) {
            throw new \LogicException("Family {$family->getCode()} is not a singleton");
        }
        $qb = $this->createQueryBuilder('e')
            ->andWhere('e.family = :familyCode')
            ->join('e.values', 'values')
            ->setParameters(
                [
                    'familyCode' => $family->getCode(),
                ]
            );

        $instance = $qb->getQuery()->getOneOrNullResult();
        if (!$instance) {
            $dataClass = $family->getDataClass();
            $instance = new $dataClass($family);
        }

        return $instance;
    }
663095
public static function GetViewScriptFullPath ($typePath = '', $corectedRelativePath = '') {
		if (self::$_viewScriptsFullPathBase === NULL)
			self::_initViewScriptsFullPathBase();
		return implode('/', [
			self::$_viewScriptsFullPathBase,
			$typePath,
			$corectedRelativePath . static::$extension
		]);
	}
1089652
protected function parseLevel( $level )
	{
		if ( isset( $this->levels[$level] ) )
			return $this->levels[$level];

		throw new InvalidArgumentException( 'Invalid log level.' );
	}
912927
protected static function formatLine($level, $message, array $context = array())
    {
        return sprintf(
            "%s: %s\n",
            self::getLevelName($level),
            self::interpolateMessage($message, $context)
        );
    }
684840
public function getChildFamilyLabel(Family $family): string
    {
        if (preg_match('/\n1 FAMC @' . $family->xref() . '@(?:\n[2-9].*)*\n2 PEDI (.+)/', $this->gedcom(), $match)) {
            // A specified pedigree
            return GedcomCodePedi::getChildFamilyLabel($match[1]);
        }

        // Default (birth) pedigree
        return GedcomCodePedi::getChildFamilyLabel('');
    }
976937
public function setFamily(FamilyInterface $family = null): FamilyPermission
    {
        $this->familyCode = $family ? $family->getCode() : null;

        return $this;
    }
882934
public static function label(FormInterface $form)
    {
        $label = $form->getConfig()->getOption('label');

        if (!$label) {
            $label = self::humanize($form->getName());
        }

        return $label;
    }
107232
protected function setFamily(FamilyInterface $family)
    {
        $this->family = $family;
        $this->container->get('router')->getContext()->setParameter('familyCode', $family->getCode());
    }
296760
public function log($level, $message, array $context = [])
        {
            if (!is_string($level) || !is_string($message)) {
                throw new \InvalidArgumentException('Level or message must be a string');
            }

            $file    = $this->logPath.'/'.$level.'.log';
            $stream  = $this->streamFactory->createStreamFromFile($file, 'a+');
            $content = $this->interpolate($message."\n", $context);   
            $stream->write($content);
        }
1040852
public function factory($type, $level = 0)
    {
        $result = null;

        if (!array_key_exists('type_extended_' . $type, $this->types)) {
            throw new InvalidTypeException;
        }

        /** @var $result ExtendedTypeInterface */
        $result = clone($this->types['type_extended_' . $type]);
        $result->setLevel($level);

        return $result;
    }
958158
public function getCapabilitiesNameForGroup($groupID)
    {
        if (!array_key_exists($groupID, $this->groupIDCapabilitiesMap)) {
            throw new \InvalidArgumentException('The Group ID ' . $groupID . ' supplied does not exist');
        }

        return $this->groupIDCapabilitiesMap[$groupID];
    }
1171852
public function getFamily(): FamilyInterface
    {
        $familyCode = $this->getConfiguration()->getOption('family');
        if (null === $familyCode) {
            throw new UnexpectedValueException(
                "Missing 'family' configuration option for {$this->getConfiguration()->getCode()}"
            );
        }

        return $this->familyRegistry->getFamily($familyCode);
    }
915506
protected function getQueryBuilderByFamily(Request $request, FamilyInterface $family)
    {
        $term = '%'.trim($request->get('term'), '%').'%';

        return $this->dataManager->getQbForFamiliesAndLabel([$family], $term);
    }
1290731
function headerLabel( $page, $level )
    {
        $headerLabel = '';
        foreach ( array_keys( $this->TOC ) as $key )
        {
            $header = $this->TOC[$key];
            if ( $header['pageNumber'] > $page )
                return $headerLabel;

            if ( $header['level'] == $level )
            {
                $headerLabel = $header['label'];
            }
            else if ( $header['level'] < $level )
            {
                $headerLabel = '';
            }
        }

        return $headerLabel;
    }
937395
public function handle(NotificationInterface $notification, $level)
    {
        if (!headers_sent())
        {
            if ($notification instanceof AttributeAwareInterface)
            {
                $options = $notification->attributes();
            }
            else
            {
                $options = [];
            }

            if ($notification instanceof TitleAwareInterface)
            {
                $options['header'] = $notification->title();
            }

            header(
                'X-' . $this->identifier . '-Notification-' . self::$messageindex++ . ':' .
                json_encode(
                    [
                        'message' => $notification->message(),
                        'type'    => isset($this->levelMapping[$level]) ? $this->levelMapping[$level] : self::STANDARD,
                        'options' => $options
                    ]
                )
            );

            return true;
        }

        return true;
    }