Why all model fields are strings?

Why all model fields are strings? If my table column type is integer how can I get model field be the integer type?

I think do it like this is not very good:

function getId()
     return (int) $this->id;

PDO returns everything as a string, so either you hardtype everything as you yourself suggested, or you make use of something like http://www.php.net/manual/en/pdostatement.getcolumnmeta.php to determine the type manually (and cache it). It is, however, not supported by all PDO drivers.