You are here

public function Agreement::getAgreementFrequencyTimestamp in Agreement 8.2

Same name and namespace in other branches
  1. 3.0.x src/Entity/Agreement.php \Drupal\agreement\Entity\Agreement::getAgreementFrequencyTimestamp()

Agreement frequency timestamp.

Return value

int The timestamp modifier to use for the frequency.

File

src/Entity/Agreement.php, line 79

Class

Agreement
Agreement entity.

Namespace

Drupal\agreement\Entity

Code

public function getAgreementFrequencyTimestamp() {
  $timestamp = 0;
  $settings = $this
    ->getSettings();
  if ($settings['frequency'] > 0) {
    $timestamp = round(time() - $settings['frequency'] * 24 * 60 * 60);
  }
  return max($settings['reset_date'], $timestamp);
}