23 lines
		
	
	
		
			503 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			503 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| namespace Bdp\Modules\EventParticipants\Reqeust;
 | |
| 
 | |
| 
 | |
| use Bdp\Libs\CommonModel;
 | |
| use Bdp\Modules\EventParticipants\Models\Event;
 | |
| use Carbon\Carbon;
 | |
| 
 | |
| class AnwesenheitRequest {
 | |
| 	public static function send(CommonModel $participant) {
 | |
| 		$anreise = \DateTime::createFromFormat('Y-m-d', $participant->anreise);
 | |
| 		$abreise = \DateTime::createFromFormat('Y-m-d', $participant->abreise);
 | |
| 
 | |
| 		$cmpd = date_diff($anreise, $abreise);
 | |
| 		$days = $cmpd->d;
 | |
| 
 | |
| 		if ($days== 0) {
 | |
| 			return 1;
 | |
| 		}
 | |
| 
 | |
| 		return $days;
 | |
| 	}
 | |
| } |