app/GedcomRecord.php
public function privatizeGedcom(int $access_level): string
    {
        if ($access_level === Auth::PRIV_HIDE) {
            // We may need the original record, for example when downloading a GEDCOM or clippings cart
            return $this->gedcom;
        }

        if ($this->canShow($access_level)) {
            // The record is not private, but the individual facts may be.

            // Include the entire first line (for NOTE records)
            [$gedrec] = explode("\n", $this->gedcom, 2);

            // Check each of the facts for access
            foreach ($this->facts([], false, $access_level) as $fact) {
                $gedrec .= "\n" . $fact->gedcom();
            }

            return $gedrec;
        }

        // We cannot display the details, but we may be able to display
        // limited data, such as links to other records.
        return $this->createPrivateGedcomRecord($access_level);
    }
public function privatizeGedcom(int $access_level): string
    {
        if ($access_level === Auth::PRIV_HIDE) {
            // We may need the original record, for example when downloading a GEDCOM or clippings cart
            return $this->gedcom;
        }

        if ($this->canShow($access_level)) {
            // The record is not private, but the individual facts may be.

            // Include the entire first line (for NOTE records)
            [$gedrec] = explode("\n", $this->gedcom, 2);

            // Check each of the facts for access
            foreach ($this->facts([], false, $access_level) as $fact) {
                $gedrec .= "\n" . $fact->gedcom();
            }

            return $gedrec;
        }

        // We cannot display the details, but we may be able to display
        // limited data, such as links to other records.
        return $this->createPrivateGedcomRecord($access_level);
    }
public function privatizeGedcom ( int $ access_level ) : string { if ( $ access_level === Auth :: PRIV_HIDE ) { // We may need the original record, for example when downloading a GEDCOM or clippings cart return $ this -> gedcom ; } if ( $ this -> canShow ( $ access_level ) ) { // The record is not private, but the individual facts may be. // Include the entire first line (for NOTE records) [ $ gedrec ] = explode ( "\n" , $ this -> gedcom , 2 ) ; // Check each of the facts for access foreach ( $ this -> facts ( [ ] , false , $ access_level ) as $ fact ) { $ gedrec .= "\n" . $ fact -> gedcom ( ) ; } return $ gedrec ; } // We cannot display the details, but we may be able to display // limited data, such as links to other records. return $ this -> createPrivateGedcomRecord ( $ access_level ) ; }
Remove private data from the raw gedcom record.
Return both the visible and invisible data. We need the invisible data when editing.

@param int $access_level

@return string
Remove private data from the raw gedcom record . Return both the visible and invisible data . We need the invisible data when editing .