Added a method to retrieve the error code directly in Phalcon

Per ticket #2930