PHP Class dbIndex, pkp-lib

This class stores information about a database index. As charactaristics of the index are loaded from the external source, methods and properties of this class are used to build up the index description in ADOdb's datadict format.
Show file Open project: pkp/pkp-lib

Public Properties

Property Type Description
$columns Indexed fields: Table columns included in this index
$drop Mark index for destruction
$name Index name
$opts Index options: Index-level options

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
addField ( string $name ) : string Adds a field to the index
addIndexOpt ( string $opt ) : string Adds options to the index
create ( object &$xmls ) : array Generates the SQL that will create the index in the database
dbIndex ( object &$parent, array $attributes = NULL ) Initializes the new dbIndex object.
drop ( ) Marks an index for destruction

Method Details

_tag_cdata() public method

Processes XML cdata.
public _tag_cdata ( &$parser, $cdata )

_tag_close() public method

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

_tag_open() public method

Processes XML opening tags. Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
public _tag_open ( &$parser, $tag, $attributes )

addField() public method

Adds a field to the index
public addField ( string $name ) : string
$name string Field name
return string Field list

addIndexOpt() public method

Adds options to the index
public addIndexOpt ( string $opt ) : string
$opt string Comma-separated list of index options.
return string Option list

create() public method

Generates the SQL that will create the index in the database
public create ( object &$xmls ) : array
$xmls object adoSchema object
return array Array containing index creation SQL

dbIndex() public method

Initializes the new dbIndex object.
public dbIndex ( object &$parent, array $attributes = NULL )
$parent object Parent object
$attributes array Attributes

drop() public method

Marks an index for destruction
public drop ( )

Property Details

$columns public property

Indexed fields: Table columns included in this index
public $columns

$drop public property

Mark index for destruction
public $drop

$name public property

Index name
public $name

$opts public property

Index options: Index-level options
public $opts