/** * Determine if the reminder has expired. * * @param object $reminder * @return bool */ protected function reminderExpired($reminder) { // Convert to array so that we can pass it to the parent method if (is_object($reminder)) { $reminder = (array) $reminder; } // Convert the DateTime object that got saved to MongoDB if (is_array($reminder['created_at'])) { $reminder['created_at'] = $reminder['created_at']['date'] + $reminder['created_at']['timezone']; } return parent::reminderExpired($reminder); }
/** * Determine if the reminder has expired. * * @param object $reminder * @return bool */ protected function reminderExpired($reminder) { // Convert MongoDate to a date string. if ($reminder['created_at'] instanceof MongoDate) { $date = new DateTime(); $date->setTimestamp($reminder['created_at']->sec); $reminder['created_at'] = $date->format('Y-m-d H:i:s'); } elseif (is_array($reminder['created_at'])) { $date = DateTime::__set_state($reminder['created_at']); $reminder['created_at'] = $date->format('Y-m-d H:i:s'); } return parent::reminderExpired($reminder); }