You are here

public function NodeRegistrationNodeSettings::min_registration_time in Node registration 7

Retrieves the minimum registration time for this event.

The time source is dubious: node field value or node settings `start_date`.

1 call to NodeRegistrationNodeSettings::min_registration_time()
NodeRegistrationNodeSettings::min_registration_time_passed in includes/node_registration.node_settings.inc
Whether the minimum registration time has passed.

File

includes/node_registration.node_settings.inc, line 166
Node settings class.

Class

NodeRegistrationNodeSettings
Node settings class.

Code

public function min_registration_time(&$origin = NULL) {

  // Get setting from node field values.
  $date_field = $this->min_registration_date_field;
  if ($time = $this
    ->time_from_date_field($date_field)) {
    $origin = 'node field value (' . $date_field . ')';
    return $time;
  }

  // DEPRECATED: Get setting from node settings.
  if ($this->start_date) {
    $time = strtotime($this->start_date);
    $origin = 'registration node settings: ' . $this->start_date;
    return $time;
  }

  // This event has no minimum registration time.
  $origin = '';
}