简体   繁体   English

教义1.2模型的代理类

[英]Proxy Class for Doctrine 1.2 models

I am writing an application where I route my methods from my application to a sevice and then to the models of Doctrine. 我正在编写一个应用程序,将方法从应用程序路由到服务,然后路由到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 im differentiating them by appending the classname viz. 现在通过附加类名vi来区分它们。

Employee_fetch()

Student_fetch()

is it possible to have a better solution than this?? 有没有比这更好的解决方案了?

It turned out that the question is about SOAP Server and setClass() method. 原来,问题在于SOAP Server和setClass()方法。

I would suggest to have different URLs for different classes. 我建议为不同的类使用不同的URL。 For example: 例如:

Then you can set the class based on the URL or GET parameter. 然后,您可以根据URL或GET参数设置类。

Please let me know if this approach might work for you. 请让我知道这种方法是否适合您。 I'm just curious. 我只是好奇。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM