29 lines
		
	
	
		
			758 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			758 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
namespace Bdp\Modules\EventParticipants\Models;
 | 
						|
 | 
						|
use Bdp\Libs\CommonModel;
 | 
						|
use Bdp\Modules\EventParticipants\Controllers\MainController;
 | 
						|
 | 
						|
class EventParticipant extends CommonModel {
 | 
						|
	public static function loadById(int $event_id) {
 | 
						|
		return parent::load_by_id('kompass_veranstaltungen_teilis', $event_id);
 | 
						|
	}
 | 
						|
 | 
						|
	public static function list_for_event(int $event_id) : array {
 | 
						|
		global $dbHandler;
 | 
						|
 | 
						|
		$data = $dbHandler->readFromDb('kompass_veranstaltungen_teilis', ['eventId' => $event_id]);
 | 
						|
		$return = [];
 | 
						|
		foreach ($data as $participant) {
 | 
						|
            $part = EventParticipant::loadById($participant->id);
 | 
						|
			$return[] = $part;
 | 
						|
		}
 | 
						|
 | 
						|
		return $return;
 | 
						|
	}
 | 
						|
 | 
						|
	public function __construct() {
 | 
						|
		$this->_tablename = 'kompass_veranstaltungen_teilis';
 | 
						|
	}
 | 
						|
}
 |