SwatDB/SwatDB.php
public static function executeStoredProc(
        $db,
        $proc,
        $params,
        $wrapper = 'SwatDBDefaultRecordsetWrapper',
        $types = null
    ) {
        if (!is_array($params)) {
            $params = array($params);
        }

        $mdb2_types = $types === null ? true : $types;

        $db->loadModule('Function');
        $rs = $db->function->executeStoredProc(
            $proc,
            $params,
            $mdb2_types,
            true,
            false
        );

        if (MDB2::isError($rs)) {
            throw new SwatDBException($rs);
        }

        // Wrap results. Do it here instead of in MDB2 so we can wrap using
        // an existing object instance.
        if (is_string($wrapper)) {
            $rs = new $wrapper($rs);
        } elseif ($wrapper instanceof SwatDBRecordsetWrapper) {
            $wrapper->initializeFromResultSet($rs);
            $rs = $wrapper;
        }

        return $rs;
    }
public static function executeStoredProc(
        $db,
        $proc,
        $params,
        $wrapper = 'SwatDBDefaultRecordsetWrapper',
        $types = null
    ) {
        if (!is_array($params)) {
            $params = array($params);
        }

        $mdb2_types = $types === null ? true : $types;

        $db->loadModule('Function');
        $rs = $db->function->executeStoredProc(
            $proc,
            $params,
            $mdb2_types,
            true,
            false
        );

        if (MDB2::isError($rs)) {
            throw new SwatDBException($rs);
        }

        // Wrap results. Do it here instead of in MDB2 so we can wrap using
        // an existing object instance.
        if (is_string($wrapper)) {
            $rs = new $wrapper($rs);
        } elseif ($wrapper instanceof SwatDBRecordsetWrapper) {
            $wrapper->initializeFromResultSet($rs);
            $rs = $wrapper;
        }

        return $rs;
    }
public static function executeStoredProc ( $ db , $ proc , $ params , $ wrapper = 'SwatDBDefaultRecordsetWrapper' , $ types = null ) { if ( ! is_array ( $ params ) ) { $ params = array ( $ params ) ; } $ mdb2_types = $ types === null ? true : $ types ; $ db -> loadModule ( 'Function' ) ; $ rs = $ db -> function -> executeStoredProc ( $ proc , $ params , $ mdb2_types , true , false ) ; if ( MDB2 :: isError ( $ rs ) ) { throw new SwatDBException ( $ rs ) ; } // Wrap results. Do it here instead of in MDB2 so we can wrap using // an existing object instance. if ( is_string ( $ wrapper ) ) { $ rs = new $ wrapper ( $ rs ) ; } elseif ( $ wrapper instanceof SwatDBRecordsetWrapper ) { $ wrapper -> initializeFromResultSet ( $ rs ) ; $ rs = $ wrapper ; } return $ rs ; }
Performs a stored procedure

@param MDB2_Driver_Common            $db      the database connection.
@param string                        $proc    the name of the stored
procedure to execute.
@param mixed                         $params  the parameters to pass to
the stored procedure. Use
an array for more than one
parameter.
@param string|SwatDBRecordsetWrapper $wrapper optional. The object or
name of class with which
to wrap the result set. If
not specified,
{@link SwatDBDefaultRecordsetWrapper}
is used. Specify
<kbd>null</kbd> to return
an unwrapped MDB2 result.
@param array                         $types   optional. An array of MDB2 datatypes
for the columns of the
result set.

@return mixed A recordset containing the query result. If <i>$wrapper</i>
is specified as null, a MDB2_Result_Common object is
returned.

@throws SwatDBException
Performs a stored procedure