Skip to content
This repository
Browse code

Adding property definition for Model::$virtualFields

  • Loading branch information...
commit 34410de7c817bc0b7a34ea8aa5ff27f08581aea8 1 parent d561405
Mark Story authored December 20, 2009

Showing 1 changed file with 16 additions and 2 deletions. Show diff stats Hide diff stats

  1. 18  cake/libs/model/model.php
18  cake/libs/model/model.php
@@ -299,6 +299,20 @@ class Model extends Overloadable {
299 299
 	var $order = null;
300 300
 
301 301
 /**
  302
+ * Array of virtual fields this model has.  Virtual fields are aliased
  303
+ * SQL expressions. Fields added to this property will be read as other fields in a model
  304
+ * but will not be saveable.
  305
+ *
  306
+ * `var $virtualFields = array('two' => '1 + 1');` 
  307
+ *
  308
+ * Is a simplistic example of how to set virtualFields
  309
+ *
  310
+ * @var array
  311
+ * @access public
  312
+ */
  313
+	var $virtualFields = array();
  314
+
  315
+/**
302 316
  * Whether or not the model record exists, set by Model::exists().
303 317
  *
304 318
  * @var bool
@@ -1057,8 +1071,8 @@ function isVirtualField($field) {
1057 1071
  *
1058 1072
  * @param mixed $name Name of field to look for
1059 1073
  * @return mixed If $field is string expression bound to virtual field $field
1060  
- *					  If $field is null, returns an array of all model virtual fields
1061  
- *               or false if none $field exist.
  1074
+ *    If $field is null, returns an array of all model virtual fields
  1075
+ *    or false if none $field exist.
1062 1076
  * @access public
1063 1077
  */
1064 1078
 	function getVirtualField($field = null) {

0 notes on commit 34410de

Please sign in to comment.
Something went wrong with that request. Please try again.