chanmix51/Pomm — pull request #41 by kcivey (2012-08-23 20:12:17+00:00)
Title: convert to numbers in Pomm\Converter\PgNumber

Currently if you do something like

$entity = $map->createObject(array('speed' => 'NOT A NUMBER'));
$map->saveOne($entity);

(where speed is a numeric column), then `NOT A NUMBER` gets interpolated into the SQL without escaping, and you get an error (and possibility of SQL injection).

This patch ensures that values for numeric columns get converted to numbers (so no escaping is required) before being substituted into the SQL statement.

Additionally, it now converts the values to numbers as they come out of the database also. That's not as necessary, but it can be convenient.