user1272589
user1272589

Reputation: 809

execute function on Database using doctrine and symfony

I have function on the database named getDtails(id) using CREATE FUNCTION on mysql

I can call it from mysql using SELECT getDetails(10) which return aninteger.

i want to execute it from symfony 1.4 using doctrine.

Upvotes: 1

Views: 1441

Answers (1)

Manse
Manse

Reputation: 38147

You could do it like this :

Doctrine_Manager::getInstance()->getCurrentConnection()
       ->fetchAssoc('SELECT getDetails(10)');

You can replace fetchAssoc with fetchArray or fetchBoth as required.

Documentation of the Doctrine_Connection class is here

Upvotes: 1

Related Questions