phpDocumentor

MydbQueryBuilder
in package
implements MydbQueryBuilderInterface

Tags
author

Sergei Shilko contact@sshilko.com

license

https://opensource.org/licenses/mit-license.php MIT

see
https://github.com/sshilko/php-sql-mydb

Table of Contents

Interfaces

MydbQueryBuilderInterface

Properties

$mysqli  : MydbMysqliEscapeStringInterface

Methods

__construct()  : mixed
buildDeleteWhere()  : string|null
buildInsertMany()  : string
buildUpdateWhere()  : string|null
buildUpdateWhereMany()  : string
buildWhere()  : string
escape()  : string
insertOne()  : string
showColumnsLike()  : string
showKeys()  : string

Properties

Methods

buildDeleteWhere()

public buildDeleteWhere(string $table[, array<string|int, mixed> $fields = [] ][, array<string|int, mixed> $negativeFields = [] ]) : string|null
Parameters
$table : string
$fields : array<string|int, mixed> = []
$negativeFields : array<string|int, mixed> = []
Tags
throws
QueryBuilderException
Return values
string|null

buildUpdateWhere()

public buildUpdateWhere(array<string, float|int|string|MydbExpressionInterface|null> $update, array<string|int, mixed> $whereFields, string $table[, array<string|int, mixed> $whereNotFields = [] ]) : string|null
Parameters
$update : array<string, float|int|string|MydbExpressionInterface|null>
$whereFields : array<string|int, mixed>
$table : string
$whereNotFields : array<string|int, mixed> = []
Tags
throws
QueryBuilderException
Return values
string|null

buildUpdateWhereMany()

public buildUpdateWhereMany(array<string|int, mixed> $columnSetWhere, array<string|int, mixed> $where, string $table) : string
Parameters
$columnSetWhere : array<string|int, mixed>

['col1' => [ ['current1', 'new1'], ['current2', 'new2']]

$where : array<string|int, mixed>

['col2' => 'value2', 'col3' => ['v3', 'v4']]

$table : string

'mytable'

Tags
throws
QueryBuilderException
phpcs:disable

SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh

Return values
string

buildWhere()

public buildWhere(array<string|int, mixed> $fields[, array<string|int, mixed> $negativeFields = [] ][, array<string|int, mixed> $likeFields = [] ]) : string
Parameters
$fields : array<string|int, mixed>
$negativeFields : array<string|int, mixed> = []
$likeFields : array<string|int, mixed> = []
Tags
throws
QueryBuilderException
todo

will this need real db connection to escape()? add test for all possible cases

phpcs:disable

SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh

Return values
string

escape()

public escape(float|int|string|MydbExpressionInterface|null $unescaped[, string $quote = "'" ]) : string
Parameters
$unescaped : float|int|string|MydbExpressionInterface|null
$quote : string = "'"
Tags
SuppressWarnings

(PHPMD.NPathComplexity)

throws
QueryBuilderException
todo

reduce NPathComplexity

phpcs:disable

SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh

Return values
string

showColumnsLike()

public showColumnsLike(string $table, string $column) : string
Parameters
$table : string
$column : string
Tags
throws
QueryBuilderException
Return values
string

        
On this page

Search results