Changeset 13683 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/attendee/attendee.php
- Timestamp:
- 05/09/2024 08:33:51 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/attendee/attendee.php
r13529 r13683 11 11 12 12 /** 13 * @var string[] 14 */ 15 private array $contributed_locales; 16 17 /** 13 18 * @throws Exception 14 19 */ 15 public function __construct( int $event_id, int $user_id ) {20 public function __construct( int $event_id, int $user_id, bool $is_host = false, array $contributed_locales = array() ) { 16 21 if ( $event_id < 1 ) { 17 22 throw new Exception( 'invalid event id' ); … … 21 26 } 22 27 23 $this->event_id = $event_id; 24 $this->user_id = $user_id; 25 $this->is_host = false; 28 $this->event_id = $event_id; 29 $this->user_id = $user_id; 30 $this->is_host = $is_host; 31 $this->contributed_locales = $contributed_locales; 26 32 } 27 33 … … 38 44 } 39 45 46 public function is_contributor(): bool { 47 return ! empty( $this->contributed_locales ); 48 } 49 40 50 public function mark_as_host(): void { 41 51 $this->is_host = true; … … 45 55 $this->is_host = false; 46 56 } 57 58 /** 59 * @return string[] 60 */ 61 public function contributed_locales(): array { 62 return $this->contributed_locales; 63 } 47 64 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)