classes/Events/API/Calendar.php
public function getOneTimeEvents($starttime = null, $endtime = null) {

		if (is_null($starttime)) {
			$starttime = time();
		}
		if (is_null($endtime)) {
			$endtime = strtotime('+1 year', $starttime);
		}

		$starttime = sanitize_int($starttime);
		$endtime = sanitize_int($endtime);
		$relationship_name = sanitize_string(self::EVENT_CALENDAR_RELATIONSHIP);

		$dbprefix = elgg_get_config('dbprefix');

		// for performance we'll denormalize metastrings first
		$mdr_name = elgg_get_metastring_id('repeat');
		$mdr_val = elgg_get_metastring_id(0);
		$mds_name = elgg_get_metastring_id('start_timestamp');
		$mde_name = elgg_get_metastring_id('end_timestamp');
		$options = array(
			'type' => 'object',
			'subtype' => Event::SUBTYPE,
			'joins' => array(
				"JOIN {$dbprefix}entity_relationships er ON er.guid_one = e.guid", // calendar relationship
				"JOIN {$dbprefix}metadata mdr ON mdr.entity_guid = e.guid", // repeating metadata
				"JOIN {$dbprefix}metadata mds ON mds.entity_guid = e.guid", // start time metadata
				"JOIN {$dbprefix}metastrings mss ON mss.id = mds.value_id", // start time metastring
				"JOIN {$dbprefix}metadata mde ON mde.entity_guid = e.guid", // end time metadata
				"JOIN {$dbprefix}metastrings mse ON mse.id = mde.value_id" // end time metastring
			),
			'wheres' => array(
				"er.guid_two = {$this->guid} AND er.relationship = '{$relationship_name}'",
				"mdr.name_id = {$mdr_name} AND mdr.value_id = {$mdr_val}",
				"mds.name_id = {$mds_name}",
				"mde.name_id = {$mde_name}",
				"((CAST(mss.string AS SIGNED) BETWEEN {$starttime} AND {$endtime})
					OR (CAST(mse.string AS SIGNED) BETWEEN {$starttime} AND {$endtime}))"
			),
			'limit' => false
		);

		return new ElggBatch('elgg_get_entities', $options);
	}
public function getOneTimeEvents($starttime = null, $endtime = null) {

		if (is_null($starttime)) {
			$starttime = time();
		}
		if (is_null($endtime)) {
			$endtime = strtotime('+1 year', $starttime);
		}

		$starttime = sanitize_int($starttime);
		$endtime = sanitize_int($endtime);
		$relationship_name = sanitize_string(self::EVENT_CALENDAR_RELATIONSHIP);

		$dbprefix = elgg_get_config('dbprefix');

		// for performance we'll denormalize metastrings first
		$mdr_name = elgg_get_metastring_id('repeat');
		$mdr_val = elgg_get_metastring_id(0);
		$mds_name = elgg_get_metastring_id('start_timestamp');
		$mde_name = elgg_get_metastring_id('end_timestamp');
		$options = array(
			'type' => 'object',
			'subtype' => Event::SUBTYPE,
			'joins' => array(
				"JOIN {$dbprefix}entity_relationships er ON er.guid_one = e.guid", // calendar relationship
				"JOIN {$dbprefix}metadata mdr ON mdr.entity_guid = e.guid", // repeating metadata
				"JOIN {$dbprefix}metadata mds ON mds.entity_guid = e.guid", // start time metadata
				"JOIN {$dbprefix}metastrings mss ON mss.id = mds.value_id", // start time metastring
				"JOIN {$dbprefix}metadata mde ON mde.entity_guid = e.guid", // end time metadata
				"JOIN {$dbprefix}metastrings mse ON mse.id = mde.value_id" // end time metastring
			),
			'wheres' => array(
				"er.guid_two = {$this->guid} AND er.relationship = '{$relationship_name}'",
				"mdr.name_id = {$mdr_name} AND mdr.value_id = {$mdr_val}",
				"mds.name_id = {$mds_name}",
				"mde.name_id = {$mde_name}",
				"((CAST(mss.string AS SIGNED) BETWEEN {$starttime} AND {$endtime})
					OR (CAST(mse.string AS SIGNED) BETWEEN {$starttime} AND {$endtime}))"
			),
			'limit' => false
		);

		return new ElggBatch('elgg_get_entities', $options);
	}
public function getOneTimeEvents ( $ starttime = null , $ endtime = null ) { if ( is_null ( $ starttime ) ) { $ starttime = time ( ) ; } if ( is_null ( $ endtime ) ) { $ endtime = strtotime ( '+1 year' , $ starttime ) ; } $ starttime = sanitize_int ( $ starttime ) ; $ endtime = sanitize_int ( $ endtime ) ; $ relationship_name = sanitize_string ( self :: EVENT_CALENDAR_RELATIONSHIP ) ; $ dbprefix = elgg_get_config ( 'dbprefix' ) ; // for performance we'll denormalize metastrings first $ mdr_name = elgg_get_metastring_id ( 'repeat' ) ; $ mdr_val = elgg_get_metastring_id ( 0 ) ; $ mds_name = elgg_get_metastring_id ( 'start_timestamp' ) ; $ mde_name = elgg_get_metastring_id ( 'end_timestamp' ) ; $ options = array ( 'type' => 'object' , 'subtype' => Event :: SUBTYPE , 'joins' => array ( "JOIN {$dbprefix}entity_relationships er ON er.guid_one = e.guid" , // calendar relationship "JOIN {$dbprefix}metadata mdr ON mdr.entity_guid = e.guid" , // repeating metadata "JOIN {$dbprefix}metadata mds ON mds.entity_guid = e.guid" , // start time metadata "JOIN {$dbprefix}metastrings mss ON mss.id = mds.value_id" , // start time metastring "JOIN {$dbprefix}metadata mde ON mde.entity_guid = e.guid" , // end time metadata "JOIN {$dbprefix}metastrings mse ON mse.id = mde.value_id" // end time metastring ) , 'wheres' => array ( "er.guid_two = {$this->guid} AND er.relationship = '{$relationship_name}'" , "mdr.name_id = {$mdr_name} AND mdr.value_id = {$mdr_val}" , "mds.name_id = {$mds_name}" , "mde.name_id = {$mde_name}" , "((CAST(mss.string AS SIGNED) BETWEEN {$starttime} AND {$endtime})
					OR (CAST(mse.string AS SIGNED) BETWEEN {$starttime} AND {$endtime}))" ) , 'limit' => false ) ; return new ElggBatch ( 'elgg_get_entities' , $ options ) ; }
Returns one-time events

@param int $starttime Time range start, default: now
@param int $endtime   Time range end, default: 1 year from start time
@return ElggBatch
Returns one - time events