Propel 2 API
Class

Propel\Generator\Behavior\Sortable\SortableBehavior

class SortableBehavior extends Behavior

Gives a model class the ability to be ordered Uses one additional column storing the rank

Methods

setName(string $name)

Sets the name of the Behavior

from Behavior
string getName()

Returns the name of the Behavior

from Behavior
setTable(Table $table)

Sets the table this behavior is applied to

from Behavior
Table getTable()

Returns the table this behavior is applied to

from Behavior
setDatabase(Database $database)

Sets the database this behavior is applied to

from Behavior
Database getDatabase()

Returns the table this behavior is applied to if behavior is applied to a database element.

from Behavior
addParameter(array $parameter)

Adds a single parameter.

setParameters(array $parameters)

Overrides the behavior parameters.

from Behavior
array getParameters()

Returns the associative array of parameters.

from Behavior
array getParameter(string $name)

Returns a single parameter by its name.

from Behavior
setTableModificationOrder(integer $tableModificationOrder)

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

from Behavior
integer getTableModificationOrder()

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

from Behavior
modifyDatabase()

This method is automatically called on database behaviors when the database model is finished.

from Behavior
modifyTable()

Add the rank_column to the current table

setTableModified(boolean $modified)

Sets whether or not the table has been modified.

from Behavior
boolean isTableModified()

Returns whether or not the table has been modified.

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

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

from Behavior
Column getColumnForParameter(string $name)

Returns a column object using a name stored in the behavior parameters.

from Behavior
appendXml(DOMNode $node)

Appends DOM elements to represent this object in XML.

from Behavior
Behavior getTableModifier()

Returns the table modifier object.

from Behavior
Behavior getObjectBuilderModifier()

Returns the object builder modifier object.

Behavior getQueryBuilderModifier()

Returns the query builder modifier object.

Behavior getTableMapBuilderModifier()

Returns the table map builder modifier object.

boolean hasAdditionalBuilders()

Returns whether or not this behavior has additional builders.

from Behavior
array getAdditionalBuilders()

Returns the list of additional builder objects.

from Behavior
useScope()

array generateScopePhp()

Generates the method argument signature, the appropriate phpDoc for @params, the scope builder php code and the scope variable builder php code/

string getColumnGetter(string $name)

Returns the getter method name.

string getColumnSetter(string $name)

Returns the setter method name.

string[] getScopes()

Returns all scope columns as array.

bool hasMultipleScopes()

Returns true if the behavior has multiple scope columns.

Details

in Behavior at line 37
public setName(string $name)

Sets the name of the Behavior

Parameters

string $name the name of the behavior

in Behavior at line 47
public string getName()

Returns the name of the Behavior

Return Value

string

in Behavior at line 57
public setTable(Table $table)

Sets the table this behavior is applied to

Parameters

Table $table

in Behavior at line 67
public Table getTable()

Returns the table this behavior is applied to

Return Value

Table

in Behavior at line 77
public setDatabase(Database $database)

Sets the database this behavior is applied to

Parameters

Database $database

in Behavior at line 88
public Database getDatabase()

Returns the table this behavior is applied to if behavior is applied to a database element.

Return Value

Database

at line 177
public addParameter(array $parameter)

Adds a single parameter.

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

Parameters

array $parameter

in Behavior at line 114
public setParameters(array $parameters)

Overrides the behavior parameters.

Expects an associative array looking like array('foo' => 'bar').

Parameters

array $parameters

in Behavior at line 124
public array getParameters()

Returns the associative array of parameters.

Return Value

array

in Behavior at line 135
public array getParameter(string $name)

Returns a single parameter by its name.

Parameters

string $name

Return Value

array

in Behavior at line 149
public setTableModificationOrder(integer $tableModificationOrder)

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

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

Default is 50.

Parameters

integer $tableModificationOrder

in Behavior at line 163
public integer getTableModificationOrder()

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

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

Default is 50.

Return Value

integer

in Behavior at line 175
public modifyDatabase()

This method is automatically called on database behaviors when the database model is finished.

Propagates the behavior to the tables of the database and override this
method to have a database behavior do something special.

at line 38
public modifyTable()

Add the rank_column to the current table

in Behavior at line 202
public setTableModified(boolean $modified)

Sets whether or not the table has been modified.

Parameters

boolean $modified

in Behavior at line 212
public boolean isTableModified()

Returns whether or not the table has been modified.

Return Value

boolean

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

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

The template file name is relative to the behavior's
directory name.

Parameters

string $filename
array $vars
string $templateDir

Return Value

string

in Behavior at line 270
public Column getColumnForParameter(string $name)

Returns a column object using a name stored in the behavior parameters.

Useful for table behaviors.

Parameters

string $name

Return Value

Column

in Behavior at line 280
public appendXml(DOMNode $node)

Appends DOM elements to represent this object in XML.

Parameters

DOMNode $node

in Behavior at line 301
public Behavior getTableModifier()

Returns the table modifier object.

The current object is returned by default.

Return Value

Behavior

at line 67
public Behavior getObjectBuilderModifier()

Returns the object builder modifier object.

The current object is returned by default.

Return Value

Behavior

at line 76
public Behavior getQueryBuilderModifier()

Returns the query builder modifier object.

The current object is returned by default.

Return Value

Behavior

at line 85
public Behavior getTableMapBuilderModifier()

Returns the table map builder modifier object.

The current object is returned by default.

Return Value

Behavior

in Behavior at line 347
public boolean hasAdditionalBuilders()

Returns whether or not this behavior has additional builders.

Return Value

boolean

in Behavior at line 357
public array getAdditionalBuilders()

Returns the list of additional builder objects.

Return Value

array

at line 94
public useScope()

at line 105
public array generateScopePhp()

Generates the method argument signature, the appropriate phpDoc for @params, the scope builder php code and the scope variable builder php code/

Return Value

array ($methodSignature, $paramsDoc, $scopeBuilder, $buildScopeVars)

at line 158
public string getColumnGetter(string $name)

Returns the getter method name.

Parameters

string $name

Return Value

string

at line 169
public string getColumnSetter(string $name)

Returns the setter method name.

Parameters

string $name

Return Value

string

at line 191
public string[] getScopes()

Returns all scope columns as array.

Return Value

string[]

at line 203
public bool hasMultipleScopes()

Returns true if the behavior has multiple scope columns.

Return Value

bool