final class IdentifierProtector (View source)

Protects compound table and column references while preserving supported SQL aliases and expressions.

Methods

Initializes this IdentifierProtector with the collaborators and state required by its database contract.

string
protect(string $item, bool $prefixSingle = false, bool|null $protectIdentifiers = null, bool $fieldExists = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

string

Details

__construct

__construct(IdentifierEscaperInterface $escaper)

Initializes this IdentifierProtector with the collaborators and state required by its database contract.

Parameters

IdentifierEscaperInterface $escaper

protect

string protect(string $item, bool $prefixSingle = false, bool|null $protectIdentifiers = null, bool $fieldExists = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $item
bool $prefixSingle
bool|null $protectIdentifiers
bool $fieldExists

Return Value

string