app/Module/MediaTabModule.php
private function getFactsWithMedia(Individual $individual): Collection
    {
        if ($this->facts === null) {
            $facts = $individual->facts();
            foreach ($individual->spouseFamilies() as $family) {
                if ($family->canShow()) {
                    foreach ($family->facts() as $fact) {
                        $facts->push($fact);
                    }
                }
            }

            $this->facts = new Collection();

            foreach ($facts as $fact) {
                if (preg_match('/(?:^1|\n\d) OBJE @' . Gedcom::REGEX_XREF . '@/', $fact->gedcom())) {
                    $this->facts->push($fact);
                }
            }
            $this->facts = Fact::sortFacts($this->facts);
        }

        return $this->facts;
    }
private function getFactsWithMedia(Individual $individual): Collection
    {
        if ($this->facts === null) {
            $facts = $individual->facts();
            foreach ($individual->spouseFamilies() as $family) {
                if ($family->canShow()) {
                    foreach ($family->facts() as $fact) {
                        $facts->push($fact);
                    }
                }
            }

            $this->facts = new Collection();

            foreach ($facts as $fact) {
                if (preg_match('/(?:^1|\n\d) OBJE @' . Gedcom::REGEX_XREF . '@/', $fact->gedcom())) {
                    $this->facts->push($fact);
                }
            }
            $this->facts = Fact::sortFacts($this->facts);
        }

        return $this->facts;
    }
private function getFactsWithMedia ( Individual $ individual ) : Collection { if ( $ this -> facts === null ) { $ facts = $ individual -> facts ( ) ; foreach ( $ individual -> spouseFamilies ( ) as $ family ) { if ( $ family -> canShow ( ) ) { foreach ( $ family -> facts ( ) as $ fact ) { $ facts -> push ( $ fact ) ; } } } $ this -> facts = new Collection ( ) ; foreach ( $ facts as $ fact ) { if ( preg_match ( '/(?:^1|\n\d) OBJE @' . Gedcom :: REGEX_XREF . '@/' , $ fact -> gedcom ( ) ) ) { $ this -> facts -> push ( $ fact ) ; } } $ this -> facts = Fact :: sortFacts ( $ this -> facts ) ; } return $ this -> facts ; }
Get all the facts for an individual which contain media objects.

@param Individual $individual

@return Collection
@return Fact[]
Get all the facts for an individual which contain media objects .