Propel API
Class

SluggableBehavior

class SluggableBehavior extends Behavior

Adds a slug column

Methods

setName($name)

from Behavior
getName()

from Behavior
setTable(Table $table)

from Behavior
getTable()

from Behavior
setDatabase(Database $database)

from Behavior
getDatabase()

from Behavior
addParameter(array $attribute)

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

from Behavior
setParameters(array $parameters)

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

from Behavior
array getParameters()

Get the associative array of parameters

from Behavior
getParameter($name)

from Behavior
setTableModificationOrder($tableModificationOrder $tableModificationOrder)

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

from Behavior
integer getTableModificationOrder()

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

from Behavior
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

from Behavior
modifyTable()

Add the slug_column to the current table

setTableModified($bool)

from Behavior
isTableModified()

from Behavior
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.

from Behavior
ColumnMap getColumnForParameter(string $param)

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

from Behavior
appendXml(DOMNode $node)

from Behavior
getTableModifier()

from Behavior
getObjectBuilderModifier()

from Behavior
getQueryBuilderModifier()

from Behavior
getPeerBuilderModifier()

from Behavior
getTableMapBuilderModifier()

from Behavior
hasAdditionalBuilders()

from Behavior
getAdditionalBuilders()

from Behavior
string preSave($builder)

Add code in ObjectBuilder::preSave

objectMethods($builder)

addCleanupSlugPart($script)

addLimitSlugSize($script)

addMakeSlugUnique($script)

queryMethods($builder)

Details

in Behavior at line 33
public setName($name)

Parameters

$name

in Behavior at line 38
public getName()

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

Parameters

Table $table

in Behavior at line 48
public getTable()

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

Parameters

Database $database

in Behavior at line 58
public getDatabase()

in Behavior 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

in Behavior 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

in Behavior at line 90
public array getParameters()

Get the associative array of parameters

Return Value

array

in Behavior at line 95
public getParameter($name)

Parameters

$name

in Behavior 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

in Behavior 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

in Behavior 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 34
public modifyTable()

Add the slug_column to the current table

in Behavior at line 144
public setTableModified($bool)

Parameters

$bool

in Behavior at line 149
public isTableModified()

in Behavior 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

in Behavior 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

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

Parameters

DOMNode $node

See also

parent::appendXml(DOMNode)

in Behavior at line 236
public getTableModifier()

in Behavior at line 241
public getObjectBuilderModifier()

in Behavior at line 246
public getQueryBuilderModifier()

in Behavior at line 251
public getPeerBuilderModifier()

in Behavior at line 256
public getTableMapBuilderModifier()

in Behavior at line 261
public hasAdditionalBuilders()

in Behavior at line 266
public getAdditionalBuilders()

at line 75
public string preSave($builder)

Add code in ObjectBuilder::preSave

Parameters

$builder

Return Value

string The code to put at the hook

at line 96
public objectMethods($builder)

Parameters

$builder

at line 186
public addCleanupSlugPart($script)

Parameters

$script

at line 229
public addLimitSlugSize($script)

Parameters

$script

at line 252
public addMakeSlugUnique($script)

Parameters

$script

at line 285
public queryMethods($builder)

Parameters

$builder