function serviceAddJupe($serviceJupe) { if ($this->getDbJupe($serviceJupe->getServer())) { return $this->serviceChangeJupe($serviceJupe); } $db_jupe = new DB_Jupe(); $db_jupe->setTs($jupe->getSetTs()); $db_jupe->setLastMod($jupe->getLastMod()); $db_jupe->setServer($jupe->getServer()); $db_jupe->setDuration($jupe->getDuration()); $db_jupe->setReason($jupe->getReason()); $db_jupe->setActiveState($jupe->isActive() ? 1 : 0); $db_jupe->save(); $jupe_key = strtolower($serviceJupe->getServer()); $this->db_jupes[$jupe_key] = $jupe; }
function serviceAddJupe($server, $duration, $last_mod, $reason) { $jupe = $this->getDbJupe($server); if (!$jupe) { return false; } $db_jupe = new DB_Jupe(); $db_jupe->setServer($jupe->getServer()); $db_jupe->setDuration($jupe->getExpireTs() - time()); $db_jupe->setLastMod($jupe->getLastMod()); $db_jupe->setTs(time()); $db_jupe->setReason($jupe->getReason()); $db_jupe->setActive($jupe->isActive()); $db_jupe->save(); $jupe_key = strtolower($server); $this->db_jupes[$jupe_key] = $jupe; }