Propel API
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 47
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 58
public array getAttributes()

Returns the assoc array of attributes.

All attribute names (keys) are lowercase.

Return Value

array

in XMLElement at line 70
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 310
public appendXml(DOMNode $node)

Parameters

DOMNode $node

See also

XMLElement::appendXml(DOMNode)

in XMLElement at line 127
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 146
public VendorInfo getVendorInfoForType($type)

Gets the any associated VendorInfo object.

Parameters

$type

Return Value

VendorInfo

in XMLElement at line 166
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 189
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 203
public __toString()

Magic string method

See also

toString()

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

Creates a new Index instance.

Parameters

string $name

at line 82
public getIsUnique()

See also

#isUnique()

at line 90
public isUnique()

Returns the uniqueness of this index.

at line 99
public getIndexName()

See also

#getName()

at line 107
public getName()

Gets the name of this index.

at line 128
public setIndexName($name)

Parameters

$name

See also

#setName(String name)

at line 136
public setName($name)

Set the name of this index.

Parameters

$name

at line 144
public setTable(Table $parent)

Set the parent Table of the index

Parameters

Table $parent

at line 152
public getTable()

Get the parent Table of the index

at line 160
public getTableName()

Returns the Name of the table the index is in

at line 169
public addColumn(mixed $data)

Adds a new column to an index.

Parameters

mixed $data Column or attributes from XML.

at line 192
public setColumns(array $indexColumns)

Sets array of columns to use for index.

Parameters

array $indexColumns Column[]

at line 206
public boolean hasColumnSize(string $name)

Whether there is a size for the specified column.

Parameters

string $name

Return Value

boolean

at line 216
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 228
public resetColumnSize()

Reset the column sizes.

Useful for generated indices for FKs

at line 237
public getIndexColumnList()

See also

#getColumnList()

at line 246
public getColumnList()

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

at line 255
public getIndexColumns()

See also

#getColumns()

at line 271
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 293
public boolean hasColumns()

Check whether the index has columns.

Return Value

boolean

at line 302
public array getColumns()

Return the list of local columns.

You should not edit this list.

Return Value

array string[]