Make getConstraint() a tiny bit more readable.
Test for a self join only when needed.
Merge pull request #2457 from bar/2.5-getconstraint

Make getConstraint() a tiny bit more readable.
Merge pull request #2459 from bar/2.5-patch

Test for self join only when needed.
Model objects should be in CamelCase.
Add a Model type hint.
Remove is_object() calls when the test subject is already type hinted as a Model.
Update DboSource::group():

* Update documentation.
* Add Model type hint.
* Bail early when fields are empty.
Add more Model type hints, and ease the model testing replacing is_object() for  '!== null'.