original_string: public static function insert($object)
      {
          $db = new DatabaseManager();
          $connection = $db->getDbh();
  
          $objectAsArrayForSqlInsert = DatatbaseUtility::objectToArrayLessId($object);
          $fields = array_keys($objectAsArrayForSqlInsert);
          $insertFieldList = DatatbaseUtility::fieldListToInsertString($fields);
          $valuesFieldList = DatatbaseUtility::fieldListToValuesString($fields);
  
          $statement = $connection->prepare('INSERT into '. static::getTableName()  . ' ' . $insertFieldList . $valuesFieldList);
          $statement->execute($objectAsArrayForSqlInsert);
  
          $queryWasSuccessful = ($statement->rowCount() > 0);
          if ($queryWasSuccessful) {
              return $connection->lastInsertId();
          } else {
              return -1;
          }
      }
code: public static function insert($object)
      {
          $db = new DatabaseManager();
          $connection = $db->getDbh();
  
          $objectAsArrayForSqlInsert = DatatbaseUtility::objectToArrayLessId($object);
          $fields = array_keys($objectAsArrayForSqlInsert);
          $insertFieldList = DatatbaseUtility::fieldListToInsertString($fields);
          $valuesFieldList = DatatbaseUtility::fieldListToValuesString($fields);
  
          $statement = $connection->prepare('INSERT into '. static::getTableName()  . ' ' . $insertFieldList . $valuesFieldList);
          $statement->execute($objectAsArrayForSqlInsert);
  
          $queryWasSuccessful = ($statement->rowCount() > 0);
          if ($queryWasSuccessful) {
              return $connection->lastInsertId();
          } else {
              return -1;
          }
      }
code_tokens: public static function insert ( $ object ) { $ db = new DatabaseManager ( ) ; $ connection = $ db -> getDbh ( ) ; $ objectAsArrayForSqlInsert = DatatbaseUtility :: objectToArrayLessId ( $ object ) ; $ fields = array_keys ( $ objectAsArrayForSqlInsert ) ; $ insertFieldList = DatatbaseUtility :: fieldListToInsertString ( $ fields ) ; $ valuesFieldList = DatatbaseUtility :: fieldListToValuesString ( $ fields ) ; $ statement = $ connection -> prepare ( 'INSERT into ' . static :: getTableName ( ) . ' ' . $ insertFieldList . $ valuesFieldList ) ; $ statement -> execute ( $ objectAsArrayForSqlInsert ) ; $ queryWasSuccessful = ( $ statement -> rowCount ( ) > 0 ) ; if ( $ queryWasSuccessful ) { return $ connection -> lastInsertId ( ) ; } else { return - 1 ; } }
docstring: insert new record into the DB table
  returns new record ID if insertation was successful, otherwise -1
  @param Object $object
  @return integer
docstring_tokens: insert new record into the DB table returns new record ID if insertation was successful otherwise - 1