Class

Index

class Index extends XMLElement

Information about indices of a table.

Constants

DEBUG

enables debug output

Methods

loadFromXML(array $attributes)

This is the entry point method for loading data from XML.

from XMLElement
array getAttributes()

Returns the assoc array of attributes.

from XMLElement
mixed getAttribute(string $name, mixed $defaultValue = null)

Gets a particular attribute by [case-insensitive] name.

from XMLElement
appendXml(DOMNode $node)

VendorInfo addVendorInfo(mixed $data)

Sets an associated VendorInfo object.

from XMLElement
VendorInfo getVendorInfoForType($type)

Gets the any associated VendorInfo object.

from XMLElement
string getConfiguredBehavior(string $bname)

Find the best class name for a given behavior Looks in build.properties for path like propel.behavior.[bname].class If not found, tries to autoload [Bname]Behavior If no success, returns 'Behavior'

from XMLElement
toString()

String representation of the current object.

from XMLElement
__toString()

Magic string method

from XMLElement
__construct(string $name = null)

Creates a new Index instance.

getIsUnique()

isUnique()

Returns the uniqueness of this index.

getIndexName()

getName()

Gets the name of this index.

setIndexName($name)

setName($name)

Set the name of this index.

setTable(Table $parent)

Set the parent Table of the index

getTable()

Get the parent Table of the index

getTableName()

Returns the Name of the table the index is in

addColumn(mixed $data)

Adds a new column to an index.

setColumns(array $indexColumns)

Sets array of columns to use for index.

boolean hasColumnSize(string $name)

Whether there is a size for the specified column.

numeric getColumnSize(string $name)

Returns the size for the specified column, if given.

resetColumnSize()

Reset the column sizes.

getIndexColumnList()

getColumnList()

Return a comma delimited string of the columns which compose this index.

getIndexColumns()

boolean hasColumnAtPosition(integer $pos, string $name, integer $size = null, boolean $caseInsensitive = false)

Check whether this index has a given column at a given position

boolean hasColumns()

Check whether the index has columns.

array getColumns()

Return the list of local columns.

Details

in XMLElement at line 48
public loadFromXML(array $attributes)

This is the entry point method for loading data from XML.

It calls a setupObject() method that must be implemented by the child class.

Parameters

array $attributes The attributes for the XML tag.

in XMLElement at line 60
public array getAttributes()

Returns the assoc array of attributes.

All attribute names (keys) are lowercase.

Return Value

array

in XMLElement at line 74
public mixed getAttribute(string $name, mixed $defaultValue = null)

Gets a particular attribute by [case-insensitive] name.

If attribute is not set then the $defaultValue is returned.

Parameters

string $name The [case-insensitive] name of the attribute to lookup.
mixed $defaultValue The default value to use in case the attribute is not set.

Return Value

mixed The value of the attribute or $defaultValue if not set.

at line 322
public appendXml(DOMNode $node)

Parameters

DOMNode $node

See also

XMLElement::appendXml(DOMNode)

in XMLElement at line 134
public VendorInfo addVendorInfo(mixed $data)

Sets an associated VendorInfo object.

Parameters

mixed $data VendorInfo object or XML attrib data (array)

Return Value

VendorInfo

in XMLElement at line 154
public VendorInfo getVendorInfoForType($type)

Gets the any associated VendorInfo object.

Parameters

$type

Return Value

VendorInfo

in XMLElement at line 176
public string getConfiguredBehavior(string $bname)

Find the best class name for a given behavior Looks in build.properties for path like propel.behavior.[bname].class If not found, tries to autoload [Bname]Behavior If no success, returns 'Behavior'

Parameters

string $bname behavior name, e.g. 'timestampable'

Return Value

string behavior class name, e.g. 'TimestampableBehavior'

Exceptions

InvalidArgumentException

in XMLElement at line 199
public toString()

String representation of the current object.

This is an xml representation with the XML declaration removed.

See also

appendXml()

in XMLElement at line 214
public __toString()

Magic string method

See also

toString()

at line 46
public __construct(string $name = null)

Creates a new Index instance.

Parameters

string $name

at line 86
public getIsUnique()

See also

#isUnique()

at line 94
public isUnique()

Returns the uniqueness of this index.

at line 103
public getIndexName()

See also

#getName()

at line 111
public getName()

Gets the name of this index.

at line 132
public setIndexName($name)

Parameters

$name

See also

#setName(String name)

at line 140
public setName($name)

Set the name of this index.

Parameters

$name

at line 148
public setTable(Table $parent)

Set the parent Table of the index

Parameters

Table $parent

at line 156
public getTable()

Get the parent Table of the index

at line 164
public getTableName()

Returns the Name of the table the index is in

at line 174
public addColumn(mixed $data)

Adds a new column to an index.

Parameters

mixed $data Column or attributes from XML.

at line 197
public setColumns(array $indexColumns)

Sets array of columns to use for index.

Parameters

array $indexColumns Column[]

at line 213
public boolean hasColumnSize(string $name)

Whether there is a size for the specified column.

Parameters

string $name

Return Value

boolean

at line 225
public numeric getColumnSize(string $name)

Returns the size for the specified column, if given.

Parameters

string $name

Return Value

numeric The size or NULL

at line 237
public resetColumnSize()

Reset the column sizes.

Useful for generated indices for FKs

at line 246
public getIndexColumnList()

See also

#getColumnList()

at line 256
public getColumnList()

Return a comma delimited string of the columns which compose this index.

at line 265
public getIndexColumns()

See also

#getColumns()

at line 281
public boolean hasColumnAtPosition(integer $pos, string $name, integer $size = null, boolean $caseInsensitive = false)

Check whether this index has a given column at a given position

Parameters

integer $pos Position in the column list
string $name Column name
integer $size optional size check
boolean $caseInsensitive Whether the comparison is case insensitive. False by default.

Return Value

boolean

at line 304
public boolean hasColumns()

Check whether the index has columns.

Return Value

boolean

at line 314
public array getColumns()

Return the list of local columns.

You should not edit this list.

Return Value

array string[]