Making WordPress.org


Ignore:
Timestamp:
04/16/2024 12:41:37 PM (19 months ago)
Author:
amieiro
Message:

Translate: Sync "Translation Events" from GitHub

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  
    120120     *
    121121     * @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
    123125     */
    124126    public function get_hosts( int $event_id ): array {
     
    128130        // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery
    129131        // phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching
    130         $host_ids = $wpdb->get_col(
     132        $rows = $wpdb->get_results(
    131133            $wpdb->prepare(
    132134                "
    133                 select user_id
     135                select event_id, user_id
    134136                from {$gp_table_prefix}event_attendees
    135137                where event_id = %d and is_host = 1
     
    143145
    144146        $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;
    147151        }
    148152        return $hosts;
Note: See TracChangeset for help on using the changeset viewer.