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

Method InternalDeactivateObject

lib/db_ido_pgsql/idopgsqlconnection.cpp:643–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643void IdoPgsqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj)
644{
645 AssertOnWorkQueue();
646
647 if (!GetConnected())
648 return;
649
650 DbReference dbref = GetObjectID(dbobj);
651
652 if (!dbref.IsValid())
653 return;
654
655 std::ostringstream qbuf;
656 qbuf << "UPDATE " + GetTablePrefix() + "objects SET is_active = 0 WHERE object_id = " << static_cast<long>(dbref);
657 IncreasePendingQueries(1);
658 Query(qbuf.str());
659
660 /* Note that we're _NOT_ clearing the db refs via SetReference/SetConfigUpdate/SetStatusUpdate
661 * because the object is still in the database. */
662
663 SetObjectActive(dbobj, false);
664}
665
666bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& value, Value *result)
667{

Callers

nothing calls this directly

Calls 1

IsValidMethod · 0.80

Tested by

no test coverage detected