/**
  * Executes a SQL query and returns the primary key of the affected row
  *
  * @param string $query SQL query
  * @return bool Returns true if all is well otherwise returns false
  * @throws \DomainException Throws an exception if the query is not valid
  */
 public function queryUpdate(string $query) : bool
 {
     $db = DB::getGlobal();
     $result = $db->query($query, $this->statementValues);
     if ($result == false) {
         throw new \DomainException(sprintf('%s $query SQL syntax error: %s', __METHOD__, $query));
     }
     $this->statementValues = array();
     return $result;
 }