0

I am writing an application where I route my methods from my application to a sevice and then to the models of Doctrine. But the server of the service is not allowing more than one class to be included. So I need to write a proxy class for all my models of the tables that have been generated by doctrine. I knw a solution that, i can have each and every method of all the classes be defined in the proxy class, so that i can include that proxy class in the server (of the service) and call my methods through the proxy class. But i guess its not a feasible method. Coz my proxy class will become huge. I need a solution where i have lesser methods in my proxy class.

My methods for every class are mostly common like

fetch()

delete()

update()

insert()

for now i m differentiating them by appending the classname viz.

Employee_fetch()

Student_fetch()

is it possible to have a better solution than this??

Sriniwas
  • 505
  • 2
  • 6
  • 21

1 Answers1

0

It turned out that the question is about SOAP Server and setClass() method.

I would suggest to have different URLs for different classes. For example:

Then you can set the class based on the URL or GET parameter.

Please let me know if this approach might work for you. I'm just curious.

Victor Smirnov
  • 3,450
  • 4
  • 30
  • 49
  • http://php.net/manual/en/soapserver.setclass.php this is the method where u set the class in the server.. its not allowing more than one class to be set.. so have any solutions abt that?? – Sriniwas Mar 07 '13 at 08:39
  • Sorry, I have to admit I did not realize that you are talking about SOAP server. I'm not perfect in reading your mind yet ;) I think the solution might be really simple. You can use different URLs for different models. In this case you can set the class based on the URL or some URL parameter. – Victor Smirnov Mar 07 '13 at 09:27
  • Sorry, do you ask me to write if ($_GET['class'] == 'class1') { $className = 'ClassNameOne'; } I have to admit I just don't understand what would be the example. How to handle GET parameters? :) – Victor Smirnov Mar 07 '13 at 16:23
  • ohh no not that.. i cant compromise of sending my classnames in URL.. i needed another solution which had good security and which also sets into my situation.. – Sriniwas Mar 08 '13 at 05:17