projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b50d890
)
RooTrait.php
author
edward
<edward@roojs.com>
Wed, 30 Mar 2016 10:23:48 +0000
(18:23 +0800)
committer
edward
<edward@roojs.com>
Wed, 30 Mar 2016 10:23:48 +0000
(18:23 +0800)
RooTrait.php
patch
|
blob
|
history
diff --git
a/RooTrait.php
b/RooTrait.php
index
54e44aa
..
741b8f6
100644
(file)
--- a/
RooTrait.php
+++ b/
RooTrait.php
@@
-69,6
+69,24
@@
trait Pman_Core_RooTrait {
}
}
+ function dataObject($tab)
+ {
+ if (is_array($this->validTables) && !in_array($tab, $this->validTables)) {
+ $this->jerr("Invalid url - not listed in validTables");
+ }
+
+ $tab = str_replace('/', '',$tab); // basic protection??
+
+ $x = DB_DataObject::factory($tab);
+
+ if (!is_a($x, 'DB_DataObject')) {
+ $this->jerr('invalid url - no dataobject');
+ }
+
+ return $x;
+
+ }
+
/*
* From Pman.php
*/
/*
* From Pman.php
*/