Permalink
Browse files

BackwardsCompatibilityBreak - Removed the debug flag from fActiveReco…

…rd. All end-user code that uses hooks needs to remove $debug from the list of parameters.
  • Loading branch information...
wbond committed Jul 21, 2008
1 parent f4a65ce commit 8410513c508cf15dd9735750a2665c122e39ba51
@@ -14,13 +14,6 @@
*/
abstract class fActiveRecord
{
/**
* If debugging is turned on for the class
*
* @var boolean
*/
protected $debug = NULL;
/**
* The old values for this record
*
@@ -197,7 +190,6 @@ public function __construct($primary_key=NULL)
$this->values,
$this->old_values,
$this->related_records,
$this->debug,
$primary_key
);
}
@@ -255,8 +247,7 @@ public function __construct($primary_key=NULL)
'post::__construct()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
@@ -337,8 +328,7 @@ public function delete()
'replace::delete()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
@@ -356,8 +346,7 @@ public function delete()
$this, 'pre::delete()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
$table = fORM::tablize($this);
@@ -375,8 +364,7 @@ public function delete()
'post-begin::delete()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
// Check to ensure no foreign dependencies prevent deletion
@@ -452,8 +440,7 @@ public function delete()
'pre-commit::delete()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
if (!$inside_db_transaction) {
@@ -465,8 +452,7 @@ public function delete()
'post-commit::delete()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
// If we just deleted an object that has an auto-incrementing primary key,
@@ -488,8 +474,7 @@ public function delete()
'post-rollback::delete()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
// Check to see if the validation exception came from a related record, and fix the message
@@ -524,24 +509,11 @@ public function delete()
'post::delete()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
/**
* Sets if debug messages should be shown
*
* @param boolean $flag If debugging messages should be shown
* @return void
*/
public function enableDebugging($flag)
{
$this->debug = (boolean) $flag;
}
/**
* Retrieves a value from the record and prepares it for output into an HTML form element.
*
@@ -661,8 +633,7 @@ public function exists()
'replace::exists()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
@@ -741,8 +712,7 @@ public function load()
'replace::load()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
@@ -807,8 +777,7 @@ protected function loadFromResult(fResult $result)
'post::loadFromResult()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
@@ -851,7 +820,6 @@ protected function loadFromIdentityMap($source)
$this->values = &$object->values;
$this->old_values = &$object->old_values;
$this->related_records = &$object->related_records;
$this->debug = &$object->debug;
return TRUE;
}
@@ -869,8 +837,7 @@ public function populate()
'replace::populate()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
@@ -879,8 +846,7 @@ public function populate()
'pre::populate()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
$table = fORM::tablize($this);
@@ -898,8 +864,7 @@ public function populate()
'post::populate()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
@@ -1079,8 +1044,7 @@ public function store()
'replace::store()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
}
@@ -1089,8 +1053,7 @@ public function store()
'pre::store()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
try {
@@ -1119,8 +1082,7 @@ public function store()
'post-begin::store()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
$this->validate();
@@ -1130,8 +1092,7 @@ public function store()
'post-validate::store()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
// Storing main table
@@ -1186,8 +1147,7 @@ public function store()
'pre-commit::store()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
if (!$inside_db_transaction) {
@@ -1199,8 +1159,7 @@ public function store()
'post-commit::store()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
} catch (fPrintableException $e) {
@@ -1214,8 +1173,7 @@ public function store()
'post-rollback::store()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
if ($new_autoincrementing_record && array_key_exists($pk_column, $this->old_values)) {
@@ -1231,8 +1189,7 @@ public function store()
'post::store()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug
$this->related_records
);
// If we got here we succefully stored, so update old values to make exists() work
@@ -1258,8 +1215,7 @@ public function validate($return_messages=FALSE)
'replace::validate()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug,
$this->related_records
$return_messages
);
}
@@ -1271,8 +1227,7 @@ public function validate($return_messages=FALSE)
'pre::validate()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug,
$this->related_records
$validation_messages
);
@@ -1289,8 +1244,7 @@ public function validate($return_messages=FALSE)
'post::validate()',
$this->values,
$this->old_values,
$this->related_records,
$this->debug,
$this->related_records
$validation_messages
);
@@ -96,12 +96,11 @@ static public function addCustomTableClassMapping($table_name, $class_name)
* @param array &$values The current values of the record
* @param array &$old_values The old values of the record
* @param array &$related_records Records related to the current record
* @param boolean $debug If debugging is turned on for this record
* @param mixed &$first_parameter The first parameter to send the callback
* @param mixed &$second_parameter The second parameter to send the callback
* @return mixed The return value from the callback. Will be NULL unless it is a replace:: callback.
*/
static public function callHookCallback(fActiveRecord $class, $hook, &$values, &$old_values, &$related_records, $debug, &$first_parameter=NULL, &$second_parameter=NULL)
static public function callHookCallback(fActiveRecord $class, $hook, &$values, &$old_values, &$related_records, &$first_parameter=NULL, &$second_parameter=NULL)
{
$class_name = self::getClassName($class);
@@ -117,7 +116,6 @@ static public function callHookCallback(fActiveRecord $class, $hook, &$values, &
&$values,
&$old_values,
&$related_records,
$debug,
&$first_parameter,
&$second_parameter
);
@@ -132,7 +130,6 @@ static public function callHookCallback(fActiveRecord $class, $hook, &$values, &
&$values,
&$old_values,
&$related_records,
$debug,
&$first_parameter,
&$second_parameter
);
@@ -442,7 +439,6 @@ static public function overrideRecordName($class, $record_name)
* 2. &$values
* 3. &$old_values
* 4. &$related_records
* 5. $debug
*
* Below is a list of other parameters passed to specific hooks:
* - 'replace::validate()': $return messages - a boolean flag indicating if the validation messages should be returned as an array instead of thrown as an exception
@@ -490,7 +486,6 @@ static public function registerHookCallback($class, $hook, $callback)
'replace::configure()',
'replace::constructInsertSQL()',
'replace::constructUpdateSQL()',
'replace::enableDebugging()',
'replace::encode()',
'replace::get()',
'replace::loadFromIdentityMap()',
Oops, something went wrong.

0 comments on commit 8410513

Please sign in to comment.