In interfaces you can force the return type
<?php
interface InterfaceTest {
function GetSingleEntity(): Entity;
function GetEntitySet() : Entity[];
}
GetEntitySet
should return a array containing Entities. But this kind of syntax is not allowed.
You could just change it to only return an array, but the forcing of the class is the most powerful.
The best is to create a wrapper class for the entities, best would be to use an Iterator.