PHP 클래스 VersionPress\Database\SqlQueryParser

파일 보기 프로젝트 열기: versionpress/versionpress 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( DbSchemaInfo $schema, Database $database ) SqlQueryParser constructor.
parseQuery ( string $query ) : ParsedQueryData Parses Sql query called. If not parseable, returns null

비공개 메소드들

메소드 설명
getColumnDataToSet ( Statement $sqlStatement ) : array Gets data which needs to be set by UPDATE statement
getParser ( $query ) : Parser If query contains some suspicious patten, we need to transform it and than create Parser for further use.
getParserFromQueryWithUsingClause ( $query, $parser, $matches, $containsUsingPattern ) : Parser
getSelectQuery ( Parser $parser, string[] $idColumns ) : string Creates Select SQL query from query in Parser
getWhereFragments ( Parser $parser, string $sqlQuery, DeleteStatement | UpdateStatement $primarySqlStatement ) : array Returns representation of WHERE SQL clauses found in whole query
parseDeleteQuery ( Parser $parser, string $query, DbSchemaInfo $schema, $database ) : ParsedQueryData Parses DELETE query
parseInsertQuery ( Parser $parser, string $query, DbSchemaInfo $schema ) : ParsedQueryData Parses INSERT query
parseUpdateQuery ( Parser $parser, string $query, DbSchemaInfo $schema, Database $database ) : ParsedQueryData Parses UPDATE query
resolveEntityName ( DbSchemaInfo $schema, string $table ) : mixed Returns entity name for a table
resolveIdColumns ( DbSchemaInfo $schema, string $table ) : string[] | null Returns ID column for a table

메소드 상세

__construct() 공개 메소드

SqlQueryParser constructor.
public __construct ( DbSchemaInfo $schema, Database $database )
$schema DbSchemaInfo
$database Database

parseQuery() 공개 메소드

Parses Sql query called. If not parseable, returns null
public parseQuery ( string $query ) : ParsedQueryData
$query string
리턴 ParsedQueryData