As your requirement is the ORM 2.3+, this can be simplified by checking the interface of Doctrine Common instead of the old ORM interface