public function Agreement::getAgreementFrequencyTimestamp in Agreement 3.0.x
Same name and namespace in other branches
- 8.2 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
- Describes an agreement configuration.
Namespace
Drupal\agreement\EntityCode
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);
}