PHP Class dbQuerySet, pkp-lib

This class compiles a list of SQL queries specified in the external file.
Show file Open project: pkp/pkp-lib Class Usage Examples

Public Properties

Property Type Description
$prefixKey Query prefix key
$prefixMethod Auto prefix enable (TRUE)
$queries List of SQL queries
$query String used to build of a query line by line

Public Methods

Method Description
_tag_cdata ( &$parser, $cdata ) XML Callback to process CDATA elements
_tag_close ( &$parser, $tag ) XML Callback to process end elements
_tag_open ( &$parser, $tag, $attributes ) XML Callback to process start elements. Elements currently processed are: QUERY.
addQuery ( ) : string Adds a completed query to the query list
buildQuery ( $sql = NULL ) : string Appends a line to a query that is being built line by line
create ( object &$xmls ) : array Creates and returns the current query set
dbQuerySet ( object &$parent, array $attributes = NULL ) Initializes the query set.
discardQuery ( ) : boolean Discards the existing query.
newQuery ( ) : boolean Re-initializes the query.
prefixQuery ( string $regex, string $query, string $prefix = NULL ) : string Rebuilds the query with the prefix attached to any objects

Method Details

_tag_cdata() public method

XML Callback to process CDATA elements
public _tag_cdata ( &$parser, $cdata )

_tag_close() public method

XML Callback to process end elements
public _tag_close ( &$parser, $tag )

_tag_open() public method

XML Callback to process start elements. Elements currently processed are: QUERY.
public _tag_open ( &$parser, $tag, $attributes )

addQuery() public method

Adds a completed query to the query list
public addQuery ( ) : string
return string SQL of added query

buildQuery() public method

Appends a line to a query that is being built line by line
public buildQuery ( $sql = NULL ) : string
return string SQL query string.

create() public method

Creates and returns the current query set
public create ( object &$xmls ) : array
$xmls object adoSchema object
return array Query set

dbQuerySet() public method

Initializes the query set.
public dbQuerySet ( object &$parent, array $attributes = NULL )
$parent object Parent object
$attributes array Attributes

discardQuery() public method

Discards the existing query.
public discardQuery ( ) : boolean
return boolean TRUE

newQuery() public method

Re-initializes the query.
public newQuery ( ) : boolean
return boolean TRUE

prefixQuery() public method

Rebuilds the query with the prefix attached to any objects
public prefixQuery ( string $regex, string $query, string $prefix = NULL ) : string
$regex string Regex used to add prefix
$query string SQL query string
$prefix string Prefix to be appended to tables, indices, etc.
return string Prefixed SQL query string.

Property Details

$prefixKey public property

Query prefix key
public $prefixKey

$prefixMethod public property

Auto prefix enable (TRUE)
public $prefixMethod

$queries public property

List of SQL queries
public $queries

$query public property

String used to build of a query line by line
public $query