From ba62eed02745b39699cab202d2d54af358c6df6e Mon Sep 17 00:00:00 2001 From: abijah Date: Tue, 28 Jul 2009 01:11:27 +0000 Subject: [PATCH] Added a debug dump function to print out a model without getting stuck on the recursive inclusion of other models. git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@393 97e9348a-65ac-dc4b-aefc-98561f571b83 --- site/app_model.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/site/app_model.php b/site/app_model.php index 83eca67..e38d6a0 100644 --- a/site/app_model.php +++ b/site/app_model.php @@ -42,6 +42,25 @@ class AppModel extends Model { var $useNullForEmpty = true; var $formatDateFields = true; + + /************************************************************************** + ************************************************************************** + ************************************************************************** + * function: queryInit + * - Initializes the query fields + */ + function prDump($all = false) { + $vars = get_object_vars($this); + foreach (array_keys($vars) AS $name) { + if (preg_match("/^[A-Z]/", $name)) + unset($vars[$name]); + if (preg_match("/^_/", $name) && !$all) + unset($vars[$name]); + } + pr($vars); + } + + /** * Get Enum Values * Snippet v0.1.3