app/Statistics/Repository/FamilyRepository.php
private function familyQuery(string $type): string
    {
        $row = DB::table('families')
            ->where('f_file', '=', $this->tree->id())
            ->orderBy('f_numchil', 'desc')
            ->first();

        if ($row === null) {
            return '';
        }

        /** @var Family $family */
        $family = Family::rowMapper()($row);

        if (!$family->canShow()) {
            return I18N::translate('This information is private and cannot be shown.');
        }

        switch ($type) {
            default:
            case 'full':
                return $family->formatList();

            case 'size':
                return I18N::number((int) $row->f_numchil);

            case 'name':
                return '<a href="' . e($family->url()) . '">' . $family->fullName() . '</a>';
        }
    }
private function familyQuery(string $type): string
    {
        $row = DB::table('families')
            ->where('f_file', '=', $this->tree->id())
            ->orderBy('f_numchil', 'desc')
            ->first();

        if ($row === null) {
            return '';
        }

        /** @var Family $family */
        $family = Family::rowMapper()($row);

        if (!$family->canShow()) {
            return I18N::translate('This information is private and cannot be shown.');
        }

        switch ($type) {
            default:
            case 'full':
                return $family->formatList();

            case 'size':
                return I18N::number((int) $row->f_numchil);

            case 'name':
                return '<a href="' . e($family->url()) . '">' . $family->fullName() . '</a>';
        }
    }
private function familyQuery ( string $ type ) : string { $ row = DB :: table ( 'families' ) -> where ( 'f_file' , '=' , $ this -> tree -> id ( ) ) -> orderBy ( 'f_numchil' , 'desc' ) -> first ( ) ; if ( $ row === null ) { return '' ; } /** @var Family $family */ $ family = Family :: rowMapper ( ) ( $ row ) ; if ( ! $ family -> canShow ( ) ) { return I18N :: translate ( 'This information is private and cannot be shown.' ) ; } switch ( $ type ) { default : case 'full' : return $ family -> formatList ( ) ; case 'size' : return I18N :: number ( ( int ) $ row -> f_numchil ) ; case 'name' : return '<a href="' . e ( $ family -> url ( ) ) . '">' . $ family -> fullName ( ) . '</a>' ; } }
General query on family.

@param string $type

@return string
General query on family .