Dictionary::Ptr UserDbObject::GetStatusFields(void) const { Dictionary::Ptr fields = make_shared<Dictionary>(); User::Ptr user = static_pointer_cast<User>(GetObject()); fields->Set("host_notifications_enabled", user->GetEnableNotifications()); fields->Set("service_notifications_enabled", user->GetEnableNotifications()); fields->Set("last_host_notification", DbValue::FromTimestamp(user->GetLastNotification())); fields->Set("last_service_notification", DbValue::FromTimestamp(user->GetLastNotification())); fields->Set("modified_attributes", user->GetModifiedAttributes()); fields->Set("modified_host_attributes", Empty); fields->Set("modified_service_attributes", Empty); return fields; }
Value ContactsTable::ServiceNotificationsEnabledAccessor(const Value& row) { User::Ptr user = static_cast<User::Ptr>(row); if (!user) return Empty; return (user->GetEnableNotifications() ? 1 : 0); }