Changeset 13541 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/attendee/attendee-repository.php
- Timestamp:
- 04/16/2024 12:41:37 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/attendee/attendee-repository.php
r13529 r13541 120 120 * 121 121 * @param int $event_id The id of the event. 122 * @return array[Attendee] The hosts of the event. 122 * 123 * @return Attendee[] The hosts of the event. 124 * @throws Exception 123 125 */ 124 126 public function get_hosts( int $event_id ): array { … … 128 130 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery 129 131 // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching 130 $ host_ids = $wpdb->get_col(132 $rows = $wpdb->get_results( 131 133 $wpdb->prepare( 132 134 " 133 select user_id135 select event_id, user_id 134 136 from {$gp_table_prefix}event_attendees 135 137 where event_id = %d and is_host = 1 … … 143 145 144 146 $hosts = array(); 145 foreach ( $host_ids as $host_id ) { 146 $hosts[] = $this->get_attendee( $event_id, $host_id ); 147 foreach ( $rows as $row ) { 148 $host = new Attendee( $row->event_id, $row->user_id ); 149 $host->mark_as_host(); 150 $hosts[] = $host; 147 151 } 148 152 return $hosts;
Note: See TracChangeset
for help on using the changeset viewer.