From: Andrey Kutejko Date: Sun, 17 Aug 2014 13:54:03 +0000 (+0300) Subject: rework debug page for 500 X-Git-Tag: 0.6~26 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=27e37095827d504acfe4f24c3843dacd80636c6e;p=ipf-legacy-orm.git rework debug page for 500 --- diff --git a/ipf/orm/collection.php b/ipf/orm/collection.php index be683a5..9bf5e52 100644 --- a/ipf/orm/collection.php +++ b/ipf/orm/collection.php @@ -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; + } } + diff --git a/ipf/orm/pager.php b/ipf/orm/pager.php index bf143d0..744f44e 100644 --- a/ipf/orm/pager.php +++ b/ipf/orm/pager.php @@ -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(), + ); + } +} + diff --git a/ipf/orm/pager/layout.php b/ipf/orm/pager/layout.php index 1d83ebb..a5c1a32 100644 --- a/ipf/orm/pager/layout.php +++ b/ipf/orm/pager/layout.php @@ -225,4 +225,12 @@ class IPF_ORM_Pager_Layout return strtr($str, $replacements); } + + public function __debugInfo() + { + return array( + 'pager' => $this->getPager() + ); + } } + diff --git a/ipf/orm/query/abstract.php b/ipf/orm/query/abstract.php index 025ac44..6e0f48a 100644 --- a/ipf/orm/query/abstract.php +++ b/ipf/orm/query/abstract.php @@ -989,4 +989,10 @@ abstract class IPF_ORM_Query_Abstract { return $this->getSqlQuery($params); } + + public function __debugInfo() + { + return array('sql' => $this->getQuery()); + } } + diff --git a/ipf/orm/record/abstract.php b/ipf/orm/record/abstract.php index 3d9a91a..07aab0d 100644 --- a/ipf/orm/record/abstract.php +++ b/ipf/orm/record/abstract.php @@ -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; + } }