app/GedcomRecord.php
public function facts(array $filter = [], bool $sort = false, int $access_level = null, bool $override = false): Collection
    {
        if ($access_level === null) {
            $access_level = Auth::accessLevel($this->tree);
        }

        $facts = new Collection();
        if ($this->canShow($access_level) || $override) {
            foreach ($this->facts as $fact) {
                if (($filter === [] || in_array($fact->getTag(), $filter, true)) && $fact->canShow($access_level)) {
                    $facts->push($fact);
                }
            }
        }

        if ($sort) {
            $facts = Fact::sortFacts($facts);
        }

        return new Collection($facts);
    }
public function facts(array $filter = [], bool $sort = false, int $access_level = null, bool $override = false): Collection
    {
        if ($access_level === null) {
            $access_level = Auth::accessLevel($this->tree);
        }

        $facts = new Collection();
        if ($this->canShow($access_level) || $override) {
            foreach ($this->facts as $fact) {
                if (($filter === [] || in_array($fact->getTag(), $filter, true)) && $fact->canShow($access_level)) {
                    $facts->push($fact);
                }
            }
        }

        if ($sort) {
            $facts = Fact::sortFacts($facts);
        }

        return new Collection($facts);
    }
public function facts ( array $ filter = [ ] , bool $ sort = false , int $ access_level = null , bool $ override = false ) : Collection { if ( $ access_level === null ) { $ access_level = Auth :: accessLevel ( $ this -> tree ) ; } $ facts = new Collection ( ) ; if ( $ this -> canShow ( $ access_level ) || $ override ) { foreach ( $ this -> facts as $ fact ) { if ( ( $ filter === [ ] || in_array ( $ fact -> getTag ( ) , $ filter , true ) ) && $ fact -> canShow ( $ access_level ) ) { $ facts -> push ( $ fact ) ; } } } if ( $ sort ) { $ facts = Fact :: sortFacts ( $ facts ) ; } return new Collection ( $ facts ) ; }
The facts and events for this record.

@param string[] $filter
@param bool     $sort
@param int|null $access_level
@param bool     $override Include private records, to allow us to implement $SHOW_PRIVATE_RELATIONSHIPS and $SHOW_LIVING_NAMES.

@return Collection
@return Fact[]
The facts and events for this record .