Skip to content

Conversation

@smarcet
Copy link
Collaborator

@smarcet smarcet commented Oct 12, 2025

No description provided.

@smarcet smarcet requested a review from Copilot October 12, 2025 23:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors a complex SQL query method in the DoctrineSpeakerRepository to use Common Table Expressions (CTEs) for better readability and maintainability. The refactoring transforms a deeply nested query with multiple UNION operations into a cleaner CTE-based approach.

  • Replaced complex nested queries with CTEs (QualifiedEvents, SpeakerIds, SpeakerRows)
  • Changed IFNULL to COALESCE for better SQL standard compliance
  • Improved code formatting and added comprehensive inline documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +701 to +706
public function getSpeakersBySummitAndOnSchedule(
Summit $summit,
PagingInfo $paging_info,
Filter $filter = null,
Order $order = null
) {
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method is missing its PHPDoc comment. This is a public API method that should have proper documentation describing its parameters and return type.

Copilot uses AI. Check for mistakes.
Comment on lines +874 to +880
(F.PresentationSpeakerID IS NOT NULL) AS Featured
FROM (SELECT DISTINCT SpeakerID FROM SpeakerIds) ds
JOIN PresentationSpeaker S ON S.ID = ds.SpeakerID
LEFT JOIN Member M ON M.ID = S.MemberID
LEFT JOIN SpeakerRegistrationRequest R ON R.SpeakerID = S.ID
LEFT JOIN Summit_FeaturedSpeakers F
ON F.PresentationSpeakerID = S.ID AND F.SummitID = {$summitId}
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Featured column logic has changed from using EXISTS to checking if a JOIN result is NOT NULL. This could potentially affect performance and behavior if there are multiple matching records in Summit_FeaturedSpeakers table, unlike the original EXISTS which was guaranteed to return boolean.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants