HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ubuntu-8gb-hel1-1 6.8.0-55-generic #57-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 23:42:21 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: /var/www/agighana.org_backup/calendar_event.class.php
<?php

class UEGoogleAPICalendarEvent extends UEGoogleAPIModel{

	/**
	 * Get the identifier.
	 *
	 * @return int
	 */
	public function getId(){

		$id = $this->getAttribute("id");

		return $id;
	}

	/**
	 * Get the title.
	 *
	 * @return string
	 */
	public function getTitle(){

		$title = $this->getAttribute("summary");

		return $title;
	}

	/**
	 * Get the description.
	 *
	 * @param bool $asHtml
	 *
	 * @return string|null
	 */
	public function getDescription($asHtml = false){

		$description = $this->getAttribute("description");

		if($asHtml === true)
			$description = nl2br($description);

		return $description;
	}

	/**
	 * Get the location.
	 *
	 * @return string|null
	 */
	public function getLocation(){

		$location = $this->getAttribute("location");

		return $location;
	}

	/**
	 * Get the URL.
	 *
	 * @return string
	 */
	public function getUrl(){

		$url = $this->getAttribute("htmlLink");

		return $url;
	}

	/**
	 * Get the start date.
	 *
	 * @param string $format
	 *
	 * @return string
	 */
	public function getStartDate($format){
		
		$start = $this->getAttribute("start");
		
		$date = $this->getDate($start, $format);
		
		return $date;
	}

	/**
	 * Get the end date.
	 *
	 * @param string $format
	 *
	 * @return string
	 */
	public function getEndDate($format){

		$end = $this->getAttribute("end");
		$date = $this->getDate($end, $format);
		
		return $date;
	}

	/**
	 * Get the date.
	 *
	 * @param object $time
	 * @param string $format
	 *
	 * @return string
	 */
	private function getDate($time, $format){

		$date = UniteFunctionsUC::getVal($time, "date", null);
		$dateTime = UniteFunctionsUC::getVal($time, "dateTime", null);

		$date = $date ?: $dateTime;
		$time = strtotime($date);
		$date = s_date($format, $time);
		
		
		return $date;
	}

}