Propel API
Class

Behavior

class Behavior extends XMLElement

Information about behaviors of a table.

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
setName($name)

getName()

setTable(Table $table)

getTable()

setDatabase(Database $database)

getDatabase()

addParameter(array $attribute)

Add a parameter Expects an associative array looking like array('name' => 'foo', 'value' => bar)

setParameters(array $parameters)

Overrides the behavior parameters Expects an associative array looking like array('foo' => 'bar')

array getParameters()

Get the associative array of parameters

getParameter($name)

setTableModificationOrder($tableModificationOrder $tableModificationOrder)

Define when this behavior must execute its modifyTable() relative to other behaviors.

integer getTableModificationOrder()

Get when this behavior must execute its modifyTable() relative to other behaviors.

modifyDatabase()

This method is automatically called on database behaviors when the database model is finished Propagate the behavior to the tables of the database Override this method to have a database behavior do something special

modifyTable()

This method is automatically called on table behaviors when the database model is finished Override it to add columns to the current table

setTableModified($bool)

isTableModified()

string renderTemplate(string $filename, array $vars = array(), string $templateDir = '/templates/')

Use Propel's simple templating system to render a PHP file using variables passed as arguments.

ColumnMap getColumnForParameter(string $param)

Retrieve a column object using a name stored in the behavior parameters Useful for table behaviors

getTableModifier()

getObjectBuilderModifier()

getQueryBuilderModifier()

getPeerBuilderModifier()

getTableMapBuilderModifier()

hasAdditionalBuilders()

getAdditionalBuilders()

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 222
public appendXml(DOMNode $node)

Parameters

DOMNode $node

See also

parent::appendXml(DOMNode)

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

Gets the any associated VendorInfo object.

Parameters

$type

Return Value

VendorInfo

in XMLElement at line 142
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'

in XMLElement at line 165
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 178
public __toString()

Magic string method

See also

toString()

at line 33
public setName($name)

Parameters

$name

at line 38
public getName()

at line 43
public setTable(Table $table)

Parameters

Table $table

at line 48
public getTable()

at line 53
public setDatabase(Database $database)

Parameters

Database $database

at line 58
public getDatabase()

at line 69
public addParameter(array $attribute)

Add a parameter Expects an associative array looking like array('name' => 'foo', 'value' => bar)

Parameters

array $attribute associative array with name and value keys

at line 81
public setParameters(array $parameters)

Overrides the behavior parameters Expects an associative array looking like array('foo' => 'bar')

Parameters

array $parameters associative array

at line 90
public array getParameters()

Get the associative array of parameters

Return Value

array

at line 95
public getParameter($name)

Parameters

$name

at line 106
public setTableModificationOrder($tableModificationOrder $tableModificationOrder)

Define when this behavior must execute its modifyTable() relative to other behaviors.

The bigger the value, the later the behavior is executed. Default is 50.

Parameters

$tableModificationOrder $tableModificationOrder integer

at line 117
public integer getTableModificationOrder()

Get when this behavior must execute its modifyTable() relative to other behaviors.

The bigger the value, the later the behavior is executed. Default is 50.

Return Value

integer

at line 127
public modifyDatabase()

This method is automatically called on database behaviors when the database model is finished Propagate the behavior to the tables of the database Override this method to have a database behavior do something special

at line 140
public modifyTable()

This method is automatically called on table behaviors when the database model is finished Override it to add columns to the current table

at line 144
public setTableModified($bool)

Parameters

$bool

at line 149
public isTableModified()

at line 164
public string renderTemplate(string $filename, array $vars = array(), string $templateDir = '/templates/')

Use Propel's simple templating system to render a PHP file using variables passed as arguments.

Parameters

string $filename The template file name, relative to the behavior's dirname
array $vars An associative array of argumens to be rendered
string $templateDir The name of the template subdirectory

Return Value

string The rendered template

at line 205
public ColumnMap getColumnForParameter(string $param)

Retrieve a column object using a name stored in the behavior parameters Useful for table behaviors

Parameters

string $param Name of the parameter storing the column name

Return Value

ColumnMap The column of the table supporting the behavior

at line 236
public getTableModifier()

at line 241
public getObjectBuilderModifier()

at line 246
public getQueryBuilderModifier()

at line 251
public getPeerBuilderModifier()

at line 256
public getTableMapBuilderModifier()

at line 261
public hasAdditionalBuilders()

at line 266
public getAdditionalBuilders()