public function searchDatabase(
        Connection $connection,
        string $databaseName,
        string $searchTerm
    ): \Generator {
        $databaseMetadata = (new MetadataFactory())->getDatabaseMetadata($connection, $databaseName);

        foreach ($databaseMetadata->getAllTableMetadata() as $tableMetadata) {
            $resultList = $this->searchTable(
                $connection,
                $tableMetadata->getDatabaseName(),
                $tableMetadata->getTableName(),
                $searchTerm
            );

            foreach ($resultList as $result) {
                yield $result;
            }
        }
    }
public function searchDatabase(
        Connection $connection,
        string $databaseName,
        string $searchTerm
    ): \Generator {
        $databaseMetadata = (new MetadataFactory())->getDatabaseMetadata($connection, $databaseName);

        foreach ($databaseMetadata->getAllTableMetadata() as $tableMetadata) {
            $resultList = $this->searchTable(
                $connection,
                $tableMetadata->getDatabaseName(),
                $tableMetadata->getTableName(),
                $searchTerm
            );

            foreach ($resultList as $result) {
                yield $result;
            }
        }
    }
public function searchDatabase ( Connection $ connection , string $ databaseName , string $ searchTerm ) : \ Generator { $ databaseMetadata = ( new MetadataFactory ( ) ) -> getDatabaseMetadata ( $ connection , $ databaseName ) ; foreach ( $ databaseMetadata -> getAllTableMetadata ( ) as $ tableMetadata ) { $ resultList = $ this -> searchTable ( $ connection , $ tableMetadata -> getDatabaseName ( ) , $ tableMetadata -> getTableName ( ) , $ searchTerm ) ; foreach ( $ resultList as $ result ) { yield $ result ; } } }
Performs a search across tables in a database.

@param Connection $connection
@param string $databaseName
@param string $searchTerm
@return \Generator|RowSearchResult[]
Performs a search across tables in a database .