diff --git a/stubs/DBAL/Connection.stub b/stubs/DBAL/Connection.stub index 15c8e6e1..8cda0657 100644 --- a/stubs/DBAL/Connection.stub +++ b/stubs/DBAL/Connection.stub @@ -74,4 +74,49 @@ class Connection */ public function transactional(Closure $func); + /** + * Executes an SQL DELETE statement on a table. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param __doctrine-literal-string $table Table name + * @param array<__doctrine-literal-string, mixed> $criteria Deletion criteria + * @param array|array $types Parameter types + * + * @return int|string The number of affected rows. + * + * @throws Exception + */ + public function delete($table, array $criteria, array $types = []); + + /** + * Executes an SQL UPDATE statement on a table. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param __doctrine-literal-string $table Table name + * @param array<__doctrine-literal-string, mixed> $data Column-value pairs + * @param array<__doctrine-literal-string, mixed> $criteria Update criteria + * @param array|array $types Parameter types + * + * @return int|string The number of affected rows. + * + * @throws Exception + */ + public function update($table, array $data, array $criteria, array $types = []); + + /** + * Inserts a table row with specified data. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param __doctrine-literal-string $table Table name + * @param array<__doctrine-literal-string, mixed> $data Column-value pairs + * @param array|array $types Parameter types + * + * @return int|string The number of affected rows. + * + * @throws Exception + */ + public function insert($table, array $data, array $types = []); } diff --git a/stubs/DBAL/Connection4.stub b/stubs/DBAL/Connection4.stub index 77b13d78..19983d79 100644 --- a/stubs/DBAL/Connection4.stub +++ b/stubs/DBAL/Connection4.stub @@ -78,4 +78,49 @@ class Connection */ public function transactional(Closure $func); + /** + * Executes an SQL DELETE statement on a table. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param __doctrine-literal-string $table + * @param array<__doctrine-literal-string, mixed> $criteria + * @param array, string|ParameterType|Type>|array $types + * + * @return int|numeric-string The number of affected rows. + * + * @throws Exception + */ + public function delete(string $table, array $criteria = [], array $types = []): int|string; + + /** + * Executes an SQL UPDATE statement on a table. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param __doctrine-literal-string $table + * @param array<__doctrine-literal-string, mixed> $data + * @param array<__doctrine-literal-string, mixed> $criteria + * @param array, string|ParameterType|Type>|array $types + * + * @return int|numeric-string The number of affected rows. + * + * @throws Exception + */ + public function update(string $table, array $data, array $criteria = [], array $types = []): int|string; + + /** + * Inserts a table row with specified data. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param __doctrine-literal-string $table + * @param array<__doctrine-literal-string, mixed> $data + * @param array, string|ParameterType|Type>|array $types + * + * @return int|numeric-string The number of affected rows. + * + * @throws Exception + */ + public function insert(string $table, array $data, array $types = []): int|string; }