I have the following class, API
, that 'receives' functions from other classes (just Pipelines
in this example), so API::getPipelines() returns Pipelines::getPipelines() and so on. The list of API functions will grow and this code will grow larger and larger was well, so I'm looking for a way to dyamically add these functions to the API
class. For example: register_methods_from(array('Pipelines', 'Blah'))
. What is the best way to do this?
class API
{
/**
* The current API instance
*/
private static $_instance = null;
[...]
/**
* Define API funcs
*/
public static function getPipelines() {
return Pipelines::getPipelines();
}
public static function getPipeline($id) {
return Pipelines::getPipeline($id);
}
// etc...