class TimestampableBehavior extends Behavior
Gives a model class the ability to track creation and last modification dates Uses two additional columns storing the creation and update date
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. |
from Behavior | |
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 create_column and update_columns 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. |
from Behavior |
Behavior |
getQueryBuilderModifier()
Returns the query builder modifier object. |
from Behavior |
Behavior |
getTableMapBuilderModifier()
Returns the table map builder modifier object. |
from Behavior |
boolean |
hasAdditionalBuilders()
Returns whether or not this behavior has additional builders. |
from Behavior |
array |
getAdditionalBuilders()
Returns the list of additional builder objects. |
from Behavior |
string |
preUpdate($builder)
Add code in ObjectBuilder::preUpdate |
|
string |
preInsert($builder)
Add code in ObjectBuilder::preInsert |
|
objectMethods($builder) | ||
queryMethods($builder) |
Details
in Behavior at line 37
public
setName(string $name)
Sets the name of the Behavior
in Behavior at line 47
public string
getName()
Returns the name of the Behavior
in Behavior at line 57
public
setTable(Table $table)
Sets the table this behavior is applied to
in Behavior at line 67
public Table
getTable()
Returns the table this behavior is applied to
in Behavior at line 77
public
setDatabase(Database $database)
Sets the database this behavior is applied to
in Behavior at line 88
public Database
getDatabase()
Returns the table this behavior is applied to if behavior is applied to a database element.
in Behavior at line 101
public
addParameter(array $parameter)
Adds a single parameter.
Expects an associative array looking like
array('name' => 'foo', 'value' => bar)
in Behavior at line 114
public
setParameters(array $parameters)
Overrides the behavior parameters.
Expects an associative array looking like array('foo' => 'bar').
in Behavior at line 124
public array
getParameters()
Returns the associative array of parameters.
in Behavior at line 135
public array
getParameter(string $name)
Returns a single parameter by its name.
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.
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.
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 32
public
modifyTable()
Add the create_column and update_columns to the current table
in Behavior at line 202
public
setTableModified(boolean $modified)
Sets whether or not the table has been modified.
in Behavior at line 212
public boolean
isTableModified()
Returns whether or not the table has been modified.
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.
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.
in Behavior at line 280
public
appendXml(DOMNode $node)
Appends DOM elements to represent this object in XML.
in Behavior at line 301
public Behavior
getTableModifier()
Returns the table modifier object.
The current object is returned by default.
in Behavior at line 313
public Behavior
getObjectBuilderModifier()
Returns the object builder modifier object.
The current object is returned by default.
in Behavior at line 325
public Behavior
getQueryBuilderModifier()
Returns the query builder modifier object.
The current object is returned by default.
in Behavior at line 337
public Behavior
getTableMapBuilderModifier()
Returns the table map builder modifier object.
The current object is returned by default.
in Behavior at line 347
public boolean
hasAdditionalBuilders()
Returns whether or not this behavior has additional builders.
in Behavior at line 357
public array
getAdditionalBuilders()
Returns the list of additional builder objects.
at line 71
public string
preUpdate($builder)
Add code in ObjectBuilder::preUpdate
at line 83
public string
preInsert($builder)
Add code in ObjectBuilder::preInsert