Drupal Services and Instantiating a Class

Posted: 2014-02-04 06:24:00

Been using Drupal Services on a project and there are some docs on how to use a Class with this. But to instantiate it I was using a function per class method. Instead I now I have one function that can instantiate the Class and method based on the 'callback' and the path 0 arg. Later I would like to just use the $_REQUEST type.

 

You can see the service below starting on line 4

Note the callback then calls to this function on line 127 which then just instantiates the class for me and calls the method.

 

 


Tags:

note2self