如何使用存储过程与Symfony和教义 [英] How to use Stored Procedures with Symfony and Doctrine

查看:145
本文介绍了如何使用存储过程与Symfony和教义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用Symfony 1.4和Doctrine 1.2调用MySQL存储过程时遇到问题。我想做的是以下内容:



在窗体中输入所有数据后的模块/新建中,我想在另一个表中插入其中一个值。



我不知道这是否可以用Doctrine完成而不使用存储过程。



感谢您的帮助。

解决方案

您可以使用触发器我不知道他们在MySQL中的进步程度如何。触发器不会涉及到Doctrine,symfony和PHP中的任何编码。只需存储过程。



您可以与Doctrine的记录监听器记录挂钩


I having problems at trying to call a MySQL Stored Procedure with Symfony 1.4 and Doctrine 1.2. What I want to do is the following:

In a module/new after typing all the data in the form, I want to insert one of the values in another table.

I don't know if this can be done with Doctrine without using a stored procedure.

Thanks for your help.

解决方案

You could use triggers but I'm not sure how advanced they are in MySQL. Triggers wouldn't involve any coding in Doctrine, symfony nor PHP. Just stored procedures.

You can achieve pretty similar effect with Doctrine's record listeners or record hooks.

这篇关于如何使用存储过程与Symfony和教义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆