public function insertChange($values) { if (!is_array($values)) { return; } // Gets it'self from the database - as we need ALL DATA for the state $component = DataCenterDB::getRow(__CLASS__, $this->category, $this->type, $this->getId()); // Checks if component existed if ($component) { // Creates a change from a component $change = DataCenterDBChange::newFromComponent($component, $values); // Inserts change $change->insert(); } }