public static function copyFrom(
        ReportQueryBuilderDelegate $otherInstance,
        ReportQueryBuilder $queryBuilder
    ) {
        $copyingInstance = new self();

        // In PHP, array assignment always performs value copying.
        $copyingInstance->selectFields = $otherInstance->selectFields;

        $copyingInstance->fromReportType = $otherInstance->fromReportType;
        $copyingInstance->duringDateRangeType =
            $otherInstance->duringDateRangeType;
        $copyingInstance->duringStartDate = $otherInstance->duringStartDate;
        $copyingInstance->duringEndDate = $otherInstance->duringEndDate;

        if (isset($otherInstance->whereBuilders)) {
            $copyingInstance->whereBuilders = [];
            foreach ($otherInstance->whereBuilders as $whereBuilder) {
                $copyingInstance->whereBuilders[] =
                    ReportQueryWhereBuilder::copyFrom(
                        $whereBuilder,
                        $queryBuilder
                    );
            }
        }
        return $copyingInstance;
    }