I\'m writing a little homebrew ORM (academic interest). I\'m trying to adhere to the TDD concept as a training exercise, and as part of that exercise I\'m writing documentat
It is acceptable to have a method that delegates to the correct internal method. You could document it like this:
@param Array|User|Integer $argName optional explanation
but then again, there is no one hindering you having one method each
public function getCollectionByRange(array $range)
public function getCollectionByUser(User $user)
public function getCollectionByUserId($id)
In addition, you could use the magic __call method to pretend the above methods exist and then capture method calls to them and delegate to your internal methods (ZF does that f.i. for finding dependant database rows). You would document these methods with the @method
annotation in the Class DocBlock. But keep in mind that the magic methods are always slower over having and/or calling the appropriate methods directly.
Use what you think makes most sense for your application and usecase.