Skip to content

Symfony2 DBAL Wrapper for Stored Procedures to Return All Result Sets

Notifications You must be signed in to change notification settings

scott-davidjones/Symfony2DBALSPWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Symfony2 Doctrine Meshup

uses the docterine db details, create new PDO connection (as doctrine wont return the actual resource, just a wrapped object) run the query and loop through reults.

example:

$sql = "EXEC someSP ?,?,?";
$sqlParams = array('param1','param2', 'param3');
$conn   = $this->getDoctrine()->getConnection();
$results = $conn->multipleResultSetsFetchAll($sql, $sqlParams);

NB

ensure you have added the wrapper to your DBAL config.yml:

doctrine:
    dbal:
        wrapper_class:  'Some\Bundle\Doctrine\DBAL\ExtendedConnection'
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        MultipleActiveResultSets: true

About

Symfony2 DBAL Wrapper for Stored Procedures to Return All Result Sets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages