2 if (!defined('GNUSOCIAL')) { exit(1); }
4 class GS_DataObject extends DB_DataObject
6 public function _autoloadClass($class, $table=false)
8 // avoid those annoying PEAR::DB strict standards warnings it causes
9 $old = error_reporting();
10 error_reporting(error_reporting() & ~E_STRICT);
12 $res = parent::_autoloadClass($class, $table);
15 error_reporting($old);
19 // wraps the _connect call so we don't throw E_STRICT warnings during it
20 public function _connect()
22 // avoid those annoying PEAR::DB strict standards warnings it causes
23 $old = error_reporting();
24 error_reporting(error_reporting() & ~E_STRICT);
26 $res = parent::_connect();
29 error_reporting($old);
33 // wraps the _loadConfig call so we don't throw E_STRICT warnings during it
34 // doesn't actually return anything, but we'll follow the same model as the rest of the wrappers
35 public function _loadConfig()
37 // avoid those annoying PEAR::DB strict standards warnings it causes
38 $old = error_reporting();
39 error_reporting(error_reporting() & ~E_STRICT);
41 $res = parent::_loadConfig();
44 error_reporting($old);
48 // wraps the count call so we don't throw E_STRICT warnings during it
49 public function count($countWhat = false,$whereAddOnly = false)
51 // avoid those annoying PEAR::DB strict standards warnings it causes
52 $old = error_reporting();
53 error_reporting(error_reporting() & ~E_STRICT);
55 $res = parent::count($countWhat, $whereAddOnly);
58 error_reporting($old);
62 static public function debugLevel($v = null)
64 // avoid those annoying PEAR::DB strict standards warnings it causes
65 $old = error_reporting();
66 error_reporting(error_reporting() & ~E_STRICT);
68 $res = parent::debugLevel($v);
71 error_reporting($old);
75 // delete calls PEAR::isError from DB_DataObject, so let's make that disappear too
76 public function delete($useWhere = false)
78 // avoid those annoying PEAR::DB strict standards warnings it causes
79 $old = error_reporting();
80 error_reporting(error_reporting() & ~E_STRICT);
82 $res = parent::delete($useWhere);
85 error_reporting($old);
89 static public function factory($table = '')
91 // avoid those annoying PEAR::DB strict standards warnings it causes
92 $old = error_reporting();
93 error_reporting(error_reporting() & ~E_STRICT);
95 $res = parent::factory($table);
98 error_reporting($old);
102 public function get($k = null, $v = null)
104 // avoid those annoying PEAR::DB strict standards warnings it causes
105 $old = error_reporting();
106 error_reporting(error_reporting() & ~E_STRICT);
108 $res = parent::get($k, $v);
111 error_reporting($old);
115 public function fetch()
117 // avoid those annoying PEAR::DB strict standards warnings it causes
118 $old = error_reporting();
119 error_reporting(error_reporting() & ~E_STRICT);
121 $res = parent::fetch();
124 error_reporting($old);
128 public function find($n = false)
130 // avoid those annoying PEAR::DB strict standards warnings it causes
131 $old = error_reporting();
132 error_reporting(error_reporting() & ~E_STRICT);
134 $res = parent::find($n);
137 error_reporting($old);
141 public function fetchRow($row = null)
143 // avoid those annoying PEAR::DB strict standards warnings it causes
144 $old = error_reporting();
145 error_reporting(error_reporting() & ~E_STRICT);
147 $res = parent::fetchRow($row);
150 error_reporting($old);
154 // insert calls PEAR::isError from DB_DataObject, so let's make that disappear too
155 public function insert()
157 // avoid those annoying PEAR::DB strict standards warnings it causes
158 $old = error_reporting();
159 error_reporting(error_reporting() & ~E_STRICT);
161 $res = parent::insert();
164 error_reporting($old);
168 // DB_DataObject's joinAdd calls DB_DataObject::factory explicitly, so our factory-override doesn't work
169 public function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false)
171 // avoid those annoying PEAR::DB strict standards warnings it causes
172 $old = error_reporting();
173 error_reporting(error_reporting() & ~E_STRICT);
175 $res = parent::joinAdd($obj, $joinType, $joinAs, $joinCol);
178 error_reporting($old);
182 public function links()
184 // avoid those annoying PEAR::DB strict standards warnings it causes
185 $old = error_reporting();
186 error_reporting(error_reporting() & ~E_STRICT);
188 $res = parent::links();
191 error_reporting($old);
195 // wraps the update call so we don't throw E_STRICT warnings during it
196 public function update($dataObject = false)
198 // avoid those annoying PEAR::DB strict standards warnings it causes
199 $old = error_reporting();
200 error_reporting(error_reporting() & ~E_STRICT);
202 $res = parent::update($dataObject);
205 error_reporting($old);
209 static public function staticGet($class, $k, $v = null)
211 // avoid those annoying PEAR::DB strict standards warnings it causes
212 $old = error_reporting();
213 error_reporting(error_reporting() & ~E_STRICT);
215 $res = parent::staticGet($class, $k, $v);
218 error_reporting($old);
222 public function staticGetAutoloadTable($table)
224 // avoid those annoying PEAR::DB strict standards warnings it causes
225 $old = error_reporting();
226 error_reporting(error_reporting() & ~E_STRICT);
228 $res = parent::staticGetAutoloadTable($table);
231 error_reporting($old);