function Currency::isObsolete in Currency 8.3
File
- src/Entity/Currency.php, line 407
Class
- Currency
- Defines a currency entity class.
Namespace
Drupal\currency\Entity
Code
function isObsolete($reference = NULL) {
if (!$this
->getUsages()) {
return FALSE;
}
if (is_null($reference)) {
$reference = time();
}
$obsolete = 0;
foreach ($this
->getUsages() as $usage) {
if ($usage
->getEnd()) {
$to = strtotime($usage
->getEnd());
if ($to !== FALSE && $to < $reference) {
$obsolete++;
}
}
}
return $obsolete == count($this
->getUsages());
}