123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?php
-
- namespace Illuminate\Database;
-
- use Closure;
-
- interface ConnectionInterface
- {
- /**
- * Begin a fluent query against a database table.
- *
- * @param string $table
- * @return \Illuminate\Database\Query\Builder
- */
- public function table($table);
-
- /**
- * Get a new raw query expression.
- *
- * @param mixed $value
- * @return \Illuminate\Database\Query\Expression
- */
- public function raw($value);
-
- /**
- * Run a select statement and return a single result.
- *
- * @param string $query
- * @param array $bindings
- * @return mixed
- */
- public function selectOne($query, $bindings = []);
-
- /**
- * Run a select statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @return array
- */
- public function select($query, $bindings = []);
-
- /**
- * Run an insert statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @return bool
- */
- public function insert($query, $bindings = []);
-
- /**
- * Run an update statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @return int
- */
- public function update($query, $bindings = []);
-
- /**
- * Run a delete statement against the database.
- *
- * @param string $query
- * @param array $bindings
- * @return int
- */
- public function delete($query, $bindings = []);
-
- /**
- * Execute an SQL statement and return the boolean result.
- *
- * @param string $query
- * @param array $bindings
- * @return bool
- */
- public function statement($query, $bindings = []);
-
- /**
- * Run an SQL statement and get the number of rows affected.
- *
- * @param string $query
- * @param array $bindings
- * @return int
- */
- public function affectingStatement($query, $bindings = []);
-
- /**
- * Run a raw, unprepared query against the PDO connection.
- *
- * @param string $query
- * @return bool
- */
- public function unprepared($query);
-
- /**
- * Prepare the query bindings for execution.
- *
- * @param array $bindings
- * @return array
- */
- public function prepareBindings(array $bindings);
-
- /**
- * Execute a Closure within a transaction.
- *
- * @param \Closure $callback
- * @param int $attempts
- * @return mixed
- *
- * @throws \Throwable
- */
- public function transaction(Closure $callback, $attempts = 1);
-
- /**
- * Start a new database transaction.
- *
- * @return void
- */
- public function beginTransaction();
-
- /**
- * Commit the active database transaction.
- *
- * @return void
- */
- public function commit();
-
- /**
- * Rollback the active database transaction.
- *
- * @return void
- */
- public function rollBack();
-
- /**
- * Get the number of active transactions.
- *
- * @return int
- */
- public function transactionLevel();
-
- /**
- * Execute the given callback in "dry run" mode.
- *
- * @param \Closure $callback
- * @return array
- */
- public function pretend(Closure $callback);
- }
|