Commit 21b46745 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Gestion des NULL pour les CLOB et BLOB

On ignore certains messages deprecated qu'on ne peut pas contourner
parent 0d53f89e
Loading
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -106,24 +106,19 @@ class Driver implements DriverInterface

        foreach ($params as $key => $val) {
            $type = isset($types[$key]) ? $types[$key] : null;
            switch ($type) {
                case Bdd::TYPE_CLOB:
                    $dkey = oci_new_descriptor($this->connexion, OCI_D_LOB);

            if (Bdd::TYPE_CLOB === $type && !empty($val)) {
                $dkey = @oci_new_descriptor($this->connexion, OCI_D_LOB);
                $dkey->writeTemporary($params[$key], OCI_TEMP_CLOB);
                    //${$key} = oci_new_descriptor($this->connexion, OCI_D_LOB);
                    //${$key}->writeTemporary($params[$key], OCI_TEMP_CLOB);
                ${$key} = $dkey;
                oci_bind_by_name($statement, ':' . $key, ${$key}, -1, OCI_B_CLOB);
                break;
                case Bdd::TYPE_BLOB:
                    ${$key} = oci_new_descriptor($this->connexion, OCI_D_LOB);
            } elseif (Bdd::TYPE_BLOB === $type && !empty($val)) {
                ${$key} = @oci_new_descriptor($this->connexion, OCI_D_LOB);
                ${$key}->writeTemporary($params[$key], OCI_TEMP_BLOB);
                oci_bind_by_name($statement, ':' . $key, ${$key}, -1, OCI_B_BLOB);
                break;
                default:
            } else {
                ${$key} = $val;
                oci_bind_by_name($statement, ':' . $key, ${$key});
                break;
            }
        }
        if (false === @oci_execute($statement, $this->commitMode)) {