@Index can be used with @ReferenceOne to use the referenced key as index.
ClassMetadata::mapManyToMany - Change a redundant 'if' to a simple assignment.
findAll() returns the query object array directly.
find($id) only retrieves the unit of work when it's used.
findBy(...) uses call_user_func_array for find the intersect, which also made $num redundant.
Merge branch 'indexed_ref_one'