MCPcopy Create free account
hub / github.com/Icinga/icinga2 / InternalDeactivateObject

Method InternalDeactivateObject

lib/db_ido_mysql/idomysqlconnection.cpp:830–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

828}
829
830void IdoMysqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj)
831{
832 AssertOnWorkQueue();
833
834 if (IsPaused())
835 return;
836
837 if (!GetConnected())
838 return;
839
840 DbReference dbref = GetObjectID(dbobj);
841
842 if (!dbref.IsValid())
843 return;
844
845 std::ostringstream qbuf;
846 qbuf << "UPDATE " + GetTablePrefix() + "objects SET is_active = 0 WHERE object_id = " << static_cast<long>(dbref);
847 IncreasePendingQueries(1);
848 AsyncQuery(qbuf.str());
849
850 /* Note that we're _NOT_ clearing the db refs via SetReference/SetConfigUpdate/SetStatusUpdate
851 * because the object is still in the database. */
852
853 SetObjectActive(dbobj, false);
854}
855
856bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& value, Value *result)
857{

Callers

nothing calls this directly

Calls 1

IsValidMethod · 0.80

Tested by

no test coverage detected