Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Doctrine\DBAL\Driver;
4
 
5
use Doctrine\DBAL\ParameterType;
6
 
7
/**
8
 * Connection interface.
9
 * Driver connections must implement this interface.
10
 *
11
 * @method resource|object getNativeConnection()
12
 */
13
interface Connection
14
{
15
    /**
16
     * Prepares a statement for execution and returns a Statement object.
17
     *
18
     * @throws Exception
19
     */
20
    public function prepare(string $sql): Statement;
21
 
22
    /**
23
     * Executes an SQL statement, returning a result set as a Statement object.
24
     *
25
     * @throws Exception
26
     */
27
    public function query(string $sql): Result;
28
 
29
    /**
30
     * Quotes a string for use in a query.
31
     *
32
     * The usage of this method is discouraged. Use prepared statements
33
     * or {@see AbstractPlatform::quoteStringLiteral()} instead.
34
     *
35
     * @param mixed $value
36
     * @param int   $type
37
     *
38
     * @return mixed
39
     */
40
    public function quote($value, $type = ParameterType::STRING);
41
 
42
    /**
43
     * Executes an SQL statement and return the number of affected rows.
44
     *
45
     * @throws Exception
46
     */
47
    public function exec(string $sql): int;
48
 
49
    /**
50
     * Returns the ID of the last inserted row or sequence value.
51
     *
52
     * @param string|null $name
53
     *
54
     * @return string|int|false
55
     *
56
     * @throws Exception
57
     */
58
    public function lastInsertId($name = null);
59
 
60
    /**
61
     * Initiates a transaction.
62
     *
63
     * @return bool TRUE on success or FALSE on failure.
64
     *
65
     * @throws Exception
66
     */
67
    public function beginTransaction();
68
 
69
    /**
70
     * Commits a transaction.
71
     *
72
     * @return bool TRUE on success or FALSE on failure.
73
     *
74
     * @throws Exception
75
     */
76
    public function commit();
77
 
78
    /**
79
     * Rolls back the current transaction, as initiated by beginTransaction().
80
     *
81
     * @return bool TRUE on success or FALSE on failure.
82
     *
83
     * @throws Exception
84
     */
85
    public function rollBack();
86
}