Hello.
For one project I use the well-known ORM PHP-ActiveRecord .
Successfully connected, earned. But there is one big BUT. With all errors and other things, this one throws out an exception, which is not always acceptable.
For example, I need to look:
$client = \Model\Client::find($someId); If there is a user, but a specific model returns to me, and if not, then
Fatal error: Uncaught exception 'ActiveRecord\RecordNotFound' And I need, let's say, to continue the code and do something else in the method being called. But Exception doesn't let me do that. Write try {..} catch ($ e) {..} for each reference to the model, you know, nonsense - all the beauty of ORM is lost.
setting set_exception_handler is generally a kill, after executing a callback, the execution of the script stops.
How can I continue to run the script, even if ORM threw an exception? How is it possible to get around? If it is not possible, what other ORM can you recommend (but not the Doctrine (:)?
Or am I not using it at all correctly?
PS: they would, instead of Exception, die () would call))