Example #1
0
 /**
  * Determine if this endpoint can re-enabled.
  *
  * @param Endpoint $newActive
  *
  * @return bool
  */
 private function canBeActivated(Endpoint $newActive)
 {
     // if newActive is currently in error, see if it can be re-enabled
     if ($newActive->isError() === true) {
         $offlineInterval = new \DateTime();
         $offlineInterval->modify('-60 minutes');
         return $newActive->getLastConnected() !== null && $newActive->getLastConnected() <= $offlineInterval;
     }
     return true;
 }