public function create(CveException &$exception) { $timestamp = new DateTime(); $this->db->query("insert into `CveException` set\n pkgId={$exception->getPkgId()},\n \t`reason`='" . $this->db->escape($exception->getReason()) . "',\n \tcveName='" . $this->db->escape($exception->getCveName()) . "',\n \tosGroupId='" . $this->db->escape($exception->getOsGroupId()) . "',\n \tmodifier='" . $this->db->escape($exception->getModifier()) . "',\n \ttimestamp='" . $timestamp->format('Y-m-d H:i:s') . "'\n \t"); # Set the newly assigned id $exception->setId($this->db->getLastInsertedId()); $exception->setTimestamp($timestamp->format('Y-m-d H:i:s')); }