Propel 2 API
Class

Propel\Generator\Model\Index

class Index extends MappingModel

Information about indices of a table.

Methods

__construct(string $name = null)

Creates a new Index instance.

loadMapping(array $attributes)

Loads a mapping definition from an array.

from MappingModel
array getAttributes()

Returns all definition attributes.

from MappingModel
mixed getAttribute(string $name, mixed $default = null)

Returns a particular attribute by a case-insensitive name.

from MappingModel
appendXml(DOMNode $node)

Appends DOM elements to represent this object in XML.

VendorInfo addVendorInfo(VendorInfo|array $vendor)

Adds a new VendorInfo instance to this current model object.

from MappingModel
VendorInfo getVendorInfoForType(string $type)

Returns a VendorInfo object by its type.

from MappingModel
string getConfiguredBehavior(string $behavior)

Returns the best class name for a given behavior.

from MappingModel
string toString()

String representation of the current object.

from MappingModel
string __toString()

String representation of the current object.

from MappingModel
boolean isUnique()

Returns the uniqueness of this index.

setName(string $name)

Sets the index name.

string getName()

Returns the index name.

setTable(Table $table)

Sets the index parent Table.

Table getTable()

Returns the index parent table.

string getTableName()

Returns the name of the index parent table.

addColumn(mixed $data)

Adds a new column to the index.

setColumns(array $columns)

Sets an array of columns to use for the index.

boolean hasColumnSize(string $name)

Returns whether or not there is a size for the specified column.

integer getColumnSize(string $name)

Returns the size for the specified column.

resetColumnsSize()

Resets the columns sizes.

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

Returns whether or not this index has a given column at a given position.

boolean hasColumns()

Returns whether or not the index has columns.

array getColumns()

Returns the list of local columns.

Details

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

Creates a new Index instance.

Parameters

string $name Name of the index

in MappingModel at line 38
public loadMapping(array $attributes)

Loads a mapping definition from an array.

Parameters

array $attributes

in MappingModel at line 58
public array getAttributes()

Returns all definition attributes.

All attribute names (keys) are lowercase.

Return Value

array

in MappingModel at line 73
public mixed getAttribute(string $name, mixed $default = null)

Returns a particular attribute by a case-insensitive name.

If the attribute is not set, then the second default value is
returned instead.

Parameters

string $name
mixed $default

Return Value

mixed

at line 259
public appendXml(DOMNode $node)

Appends DOM elements to represent this object in XML.

Parameters

DOMNode $node

in MappingModel at line 138
public VendorInfo addVendorInfo(VendorInfo|array $vendor)

Adds a new VendorInfo instance to this current model object.

Parameters

VendorInfo|array $vendor

Return Value

VendorInfo

in MappingModel at line 158
public VendorInfo getVendorInfoForType(string $type)

Returns a VendorInfo object by its type.

Parameters

string $type

Return Value

VendorInfo

in MappingModel at line 176
public string getConfiguredBehavior(string $behavior)

Returns the best class name for a given behavior.

If not found, the method tries to autoload \Propel\Generator\Behavior\[Bname]\[Bname]Behavior

Parameters

string $behavior The behavior name (ie: timestampable)

Return Value

string $class The behavior fully qualified class name

Exceptions

BehaviorNotFoundException

in MappingModel at line 198
public string toString()

String representation of the current object.

Return Value

string

in MappingModel at line 213
public string __toString()

String representation of the current object.

Return Value

string

at line 51
public boolean isUnique()

Returns the uniqueness of this index.

Return Value

boolean

at line 61
public setName(string $name)

Sets the index name.

Parameters

string $name

at line 71
public string getName()

Returns the index name.

Return Value

string

at line 105
public setTable(Table $table)

Sets the index parent Table.

Parameters

Table $table

at line 115
public Table getTable()

Returns the index parent table.

Return Value

Table

at line 125
public string getTableName()

Returns the name of the index parent table.

Return Value

string

at line 135
public addColumn(mixed $data)

Adds a new column to the index.

Parameters

mixed $data Column or attributes from XML.

at line 158
public setColumns(array $columns)

Sets an array of columns to use for the index.

Parameters

array $columns

at line 173
public boolean hasColumnSize(string $name)

Returns whether or not there is a size for the specified column.

Parameters

string $name

Return Value

boolean

at line 184
public integer getColumnSize(string $name)

Returns the size for the specified column.

Parameters

string $name

Return Value

integer

at line 194
public resetColumnsSize()

Resets the columns sizes.

This method is useful for generated indices for FKs.

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

Returns whether or not 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 or not the comparison is case insensitive (false by default)

Return Value

boolean

at line 237
public boolean hasColumns()

Returns whether or not the index has columns.

Return Value

boolean

at line 249
public array getColumns()

Returns the list of local columns.

You should not edit this list.

Return Value

array