app/Module/ClippingsCartModule.php
private function addRecordToCart(GedcomRecord $record): void
    {
        $cart = Session::get('cart', []);

        $tree_name = $record->tree()->name();

        // Add this record
        $cart[$tree_name][$record->xref()] = true;

        // Add directly linked media, notes, repositories and sources.
        preg_match_all('/\n\d (?:OBJE|NOTE|SOUR|REPO) @(' . Gedcom::REGEX_XREF . ')@/', $record->gedcom(), $matches);

        foreach ($matches[1] as $match) {
            $cart[$tree_name][$match] = true;
        }

        Session::put('cart', $cart);
    }
private function addRecordToCart(GedcomRecord $record): void
    {
        $cart = Session::get('cart', []);

        $tree_name = $record->tree()->name();

        // Add this record
        $cart[$tree_name][$record->xref()] = true;

        // Add directly linked media, notes, repositories and sources.
        preg_match_all('/\n\d (?:OBJE|NOTE|SOUR|REPO) @(' . Gedcom::REGEX_XREF . ')@/', $record->gedcom(), $matches);

        foreach ($matches[1] as $match) {
            $cart[$tree_name][$match] = true;
        }

        Session::put('cart', $cart);
    }
private function addRecordToCart ( GedcomRecord $ record ) : void { $ cart = Session :: get ( 'cart' , [ ] ) ; $ tree_name = $ record -> tree ( ) -> name ( ) ; // Add this record $ cart [ $ tree_name ] [ $ record -> xref ( ) ] = true ; // Add directly linked media, notes, repositories and sources. preg_match_all ( '/\n\d (?:OBJE|NOTE|SOUR|REPO) @(' . Gedcom :: REGEX_XREF . ')@/' , $ record -> gedcom ( ) , $ matches ) ; foreach ( $ matches [ 1 ] as $ match ) { $ cart [ $ tree_name ] [ $ match ] = true ; } Session :: put ( 'cart' , $ cart ) ; }
Add a record (and direclty linked sources, notes, etc. to the cart.

@param GedcomRecord $record

@return void
Add a record ( and direclty linked sources notes etc . to the cart .