]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
rework debug page for 500
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 17 Aug 2014 13:54:03 +0000 (16:54 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 17 Aug 2014 13:54:03 +0000 (16:54 +0300)
ipf/orm/collection.php
ipf/orm/pager.php
ipf/orm/pager/layout.php
ipf/orm/query/abstract.php
ipf/orm/record/abstract.php

index be683a5089d9a83a3ac87808378d9bdac7779203..9bf5e52f812ef8bef0113341f3ca302d49595f98 100644 (file)
@@ -544,4 +544,13 @@ class IPF_ORM_Collection extends IPF_ORM_Access implements Countable, IteratorAg
     {
         return $this->relation;
     }
+
+    public function __debugInfo()
+    {
+        $r = array();
+        foreach ($this->data as $item)
+            $r[] = $item;
+        return $r;
+    }
 }
+
index bf143d024db26e157f9c60f9d5fd591b8eb3c7cf..744f44e16db96fb1235f066dff16b60c467a2329 100644 (file)
@@ -252,4 +252,14 @@ class IPF_ORM_Pager
         }
         return $this->getQuery()->execute($params, $hydrationMode);
     }
-}
\ No newline at end of file
+
+    public function __debugInfo()
+    {
+        return array(
+            'page' => $this->getPage(),
+            'size' => $this->getMaxPerPage(),
+            'query' => $this->getQuery(),
+        );
+    }
+}
+
index 1d83ebb7314e03108a7f0658f21a77bf1f4fcd9d..a5c1a32b74aed32e1f0854aa7acf62e5a094965a 100644 (file)
@@ -225,4 +225,12 @@ class IPF_ORM_Pager_Layout
 
         return strtr($str, $replacements);
     }
+
+    public function __debugInfo()
+    {
+        return array(
+            'pager' => $this->getPager()
+        );
+    }
 }
+
index 025ac448d2bb20518d1daf77d38070abf81a4e1d..6e0f48ac2723e7f5bc75aef814181b652443f6ec 100644 (file)
@@ -989,4 +989,10 @@ abstract class IPF_ORM_Query_Abstract
     {
         return $this->getSqlQuery($params);
     }
+
+    public function __debugInfo()
+    {
+        return array('sql' => $this->getQuery());
+    }
 }
+
index 3d9a91a2481ecdb74b268484c223586038997e96..07aab0d0ade0eeab6cfd9cefc7b48035ce6e61f5 100644 (file)
@@ -48,5 +48,13 @@ abstract class IPF_ORM_Record_Abstract extends IPF_ORM_Access
         }
         return $this;
     }
+
+    public function __debugInfo()
+    {
+        $r = array();
+        foreach ($this->getTable()->getColumnNames() as $column)
+            $r[$column] = $this->get($column);
+        return $r;
+    }
 }