Not that I know of. No interface will make your object be also an array
and that's what you need to pass to usort()
. However you can encapsulate this behaviour in your class by adding usort()
method to your class.
class CollectionEntity implements Countable, IteratorAggregate, ArrayAccess {
private $data = array();
/* other methods omitted for simplicity */
public function usort(Closure $callback) {
usort($this->data,$callback);
}
}