I would suggest using plain PDO. In the following example, I call the stored procedure and get the value of the parameter OUT.
Procedure with parameters INand OUT:
CREATE PROCEDURE `CLONE_MEMBER_PRODUCT` (IN ID INT, OUT NEW_ID INT)
BEGIN
END;
getWrappedConnection()returns an instance Doctrine\DBAL\Driver\Connectionthat is only a wrapper forPDO
$connection = $this->getEntityManager()
->getConnection()
->getWrappedConnection();
$stmt = $connection->prepare('CALL CLONE_MEMBER_PRODUCT(?, @NEW_ID)');
$stmt->bindParam(1, $id, \PDO::PARAM_INT);
$stmt->execute();
$stmt = $connection->query("SELECT @NEW_ID");
$id = $stmt->fetchColumn();
source
share