civicrm/civicrm-core — pull request #4553 by anemirovsky (2014-11-13 18:35:53+00:00)
Title: Add a new findById DAO method.

We have found it very useful to have this simple function, which retrieves a
DAO object of a specific type by ID or throws an exception if one is not
found.

This can be called by using something like
CRM_Contribute_BAO_Contribution::findById(35), which will retrieve a
Contribution Object for that id, if it exists.