Function __global->detect_happening_at

Definitions

sources/calendar.php

  • Detect conflicts with an event in certain time periods.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$member_id MEMBER No No required parameter N/A N/A The member to detect conflicts for
$skip_id ?AUTO_LINK No No required parameter N/A N/A The event ID that we are detecting conflicts with (we need this so we don't think we conflict with ourself) (null: not added yet)
$our_times array No No required parameter N/A N/A List of pairs specifying our happening time (in time order)
$restrict boolean No No True N/A N/A Whether to restrict only to viewable events for the current member
$period_start ?TIME No No Null N/A N/A The timestamp that found times must exceed. In user-time (null: use find_periods_recurrence default)
$period_end ?TIME No No Null N/A N/A The timestamp that found times must not exceed. In user-time (null: use find_periods_recurrence default)

Returns

  • A list of events happening, with time details
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Detect conflicts with an event in certain time periods.
 *
 * @param  MEMBER $member_id The member to detect conflicts for
 * @param  ?AUTO_LINK $skip_id The event ID that we are detecting conflicts with (we need this so we don't think we conflict with ourself) (null: not added yet)
 * @param  array $our_times List of pairs specifying our happening time (in time order)
 * @param  boolean $restrict Whether to restrict only to viewable events for the current member
 * @param  ?TIME $period_start The timestamp that found times must exceed. In user-time (null: use find_periods_recurrence default)
 * @param  ?TIME $period_end The timestamp that found times must not exceed. In user-time (null: use find_periods_recurrence default)
 * @return array A list of events happening, with time details
 */

function detect_happening_at(int $member_id, ?int $skip_id, array $our_times, bool $restrict = true, ?int $period_start = null, ?int $period_end = null) : array