app/Services/ClipboardService.php
public function pastableFactsOfType(GedcomRecord $record, Collection $types): Collection
    {
        // The facts are stored in the session.
        return (new Collection(Session::get('clipboard', [])))
            ->flatten(1)
            ->reverse()
            ->map(static function (array $clipping) use ($record): Fact {
                return new Fact($clipping['factrec'], $record, md5($clipping['factrec']));
            })
            ->filter(static function (Fact $fact) use ($types): bool {
                return $types->contains($fact->getTag());
            });
    }
public function pastableFactsOfType(GedcomRecord $record, Collection $types): Collection
    {
        // The facts are stored in the session.
        return (new Collection(Session::get('clipboard', [])))
            ->flatten(1)
            ->reverse()
            ->map(static function (array $clipping) use ($record): Fact {
                return new Fact($clipping['factrec'], $record, md5($clipping['factrec']));
            })
            ->filter(static function (Fact $fact) use ($types): bool {
                return $types->contains($fact->getTag());
            });
    }
public function pastableFactsOfType ( GedcomRecord $ record , Collection $ types ) : Collection { // The facts are stored in the session. return ( new Collection ( Session :: get ( 'clipboard' , [ ] ) ) ) -> flatten ( 1 ) -> reverse ( ) -> map ( static function ( array $ clipping ) use ( $ record ) : Fact { return new Fact ( $ clipping [ 'factrec' ] , $ record , md5 ( $ clipping [ 'factrec' ] ) ) ; } ) -> filter ( static function ( Fact $ fact ) use ( $ types ) : bool { return $ types -> contains ( $ fact -> getTag ( ) ) ; } ) ; }
Find facts of a given type, from all records.

@param GedcomRecord $record
@param Collection   $types

@return Collection
@return Fact[]
Find facts of a given type from all records .