Adding property definition for Model::$virtualFields

This commit is contained in:
Mark Story 2009-12-20 16:26:12 -05:00
parent d561405daa
commit 34410de7c8

View file

@ -298,6 +298,20 @@ class Model extends Overloadable {
*/ */
var $order = null; var $order = null;
/**
* Array of virtual fields this model has. Virtual fields are aliased
* SQL expressions. Fields added to this property will be read as other fields in a model
* but will not be saveable.
*
* `var $virtualFields = array('two' => '1 + 1');`
*
* Is a simplistic example of how to set virtualFields
*
* @var array
* @access public
*/
var $virtualFields = array();
/** /**
* Whether or not the model record exists, set by Model::exists(). * Whether or not the model record exists, set by Model::exists().
* *
@ -1057,8 +1071,8 @@ class Model extends Overloadable {
* *
* @param mixed $name Name of field to look for * @param mixed $name Name of field to look for
* @return mixed If $field is string expression bound to virtual field $field * @return mixed If $field is string expression bound to virtual field $field
* If $field is null, returns an array of all model virtual fields * If $field is null, returns an array of all model virtual fields
* or false if none $field exist. * or false if none $field exist.
* @access public * @access public
*/ */
function getVirtualField($field = null) { function getVirtualField($field = null) {