|
VTL referencePlain keywords represent actual names of properties or methods, while keywords in italic stand for user variables and indicate their type. The r and w tags mean that an attribute is readable and/or writable (in the sense of the Velocity template language, i.e. an attribute is read by referencing it, and modified using the #set directive). All methods that take a 1. Database attributes and methods$db.entity_name r : entity.
$db.root_attribute_name r : root attribute or root action. The value of an action is the number of affected rows.
$db.error r : last error message encountered. We generally know that an error has occured when one of the methods returns null or false.
2. Entity attributes and methods$entity.fetch(values_list) : returns the instance defined by the values of its primary key columns, or null otherwise.
$entity.fetch(value) : returns the instance defined by the value of its unique primary key, or null otherwise.
#foreach
($instance in $entity) : loop on all
(or a subset of - if refined) instances of this
entity.
$entity.refine("sql-condition") : use this method to specify an additionnal SQL condition before issuing a #foreach directive on this entity. Can be called several times. Reseted in every context.
$entity.clearRefinement( ) :
clear any refinement clauses for this entity $entity.update(values_map) : update a row in this entity's table. Velosurf will ensure all key columns are specified, to avoid an accidental massive update.
$entity.delete(values_map) : delete a row from this entity's table. Velosurf will ensure all key columns are specified, to avoid an accidental massive delete.
$entity.insert(values_map) : insert a new row in this entity's table.
$entity.lastInsertID :
last inserted ID, for entities with only one primary key column,
autoincremented. 3. Attribute attributes and methodsOnly multivalued attributes can be referenced from
templates. Others are directly evaluated when
referenced. 4. Action attributes and methodsAn action has no attribute and no method. It is executed when referenced, and returns the number of affected rows. 5. Instance attributes and methods$instance.entity r
: the name of this instance's entity, or null if it's a generic
instance.
The writable form of the previous attribute, as long as the following methods, are not advised in a MVC architecture. $instance.update(values_map)
: update the row of this instance, from passed values. Velosurf
will ensure all key columns are specified, to avoid an accidental
massive update. |