]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/GS_DataObject.php
Opps, left-overs from merge ...
[quix0rs-gnu-social.git] / classes / GS_DataObject.php
1 <?php
2 if (!defined('GNUSOCIAL')) { exit(1); }
3
4 class GS_DataObject extends DB_DataObject
5 {
6     public function _autoloadClass($class, $table=false)
7     {
8         // avoid those annoying PEAR::DB strict standards warnings it causes
9         $old = error_reporting();
10         error_reporting(error_reporting() & ~E_STRICT);
11
12         $res = parent::_autoloadClass($class, $table);
13
14         // reset
15         error_reporting($old);
16         return $res;
17     }
18
19     // wraps the _connect call so we don't throw E_STRICT warnings during it
20     public function _connect()
21     {
22         // avoid those annoying PEAR::DB strict standards warnings it causes
23         $old = error_reporting();
24         error_reporting(error_reporting() & ~E_STRICT);
25
26         $res = parent::_connect();
27
28         // reset
29         error_reporting($old);
30         return $res;
31     }
32
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()
36     {
37         // avoid those annoying PEAR::DB strict standards warnings it causes
38         $old = error_reporting();
39         error_reporting(error_reporting() & ~E_STRICT);
40
41         $res = parent::_loadConfig();
42
43         // reset
44         error_reporting($old);
45         return $res;
46     }
47
48     // wraps the count call so we don't throw E_STRICT warnings during it
49     public function count($countWhat = false,$whereAddOnly = false)
50     {
51         // avoid those annoying PEAR::DB strict standards warnings it causes
52         $old = error_reporting();
53         error_reporting(error_reporting() & ~E_STRICT);
54
55         $res = parent::count($countWhat, $whereAddOnly);
56
57         // reset
58         error_reporting($old);
59         return $res;
60     }
61
62     static public function debugLevel($v = null)
63     {
64         // avoid those annoying PEAR::DB strict standards warnings it causes
65         $old = error_reporting();
66         error_reporting(error_reporting() & ~E_STRICT);
67
68         $res = parent::debugLevel($v);
69
70         // reset
71         error_reporting($old);
72         return $res;
73     }
74
75     // delete calls PEAR::isError from DB_DataObject, so let's make that disappear too
76     public function delete($useWhere = false)
77     {
78         // avoid those annoying PEAR::DB strict standards warnings it causes
79         $old = error_reporting();
80         error_reporting(error_reporting() & ~E_STRICT);
81
82         $res = parent::delete($useWhere);
83
84         // reset
85         error_reporting($old);
86         return $res;
87     }
88
89     static public function factory($table = '')
90     {
91         // avoid those annoying PEAR::DB strict standards warnings it causes
92         $old = error_reporting();
93         error_reporting(error_reporting() & ~E_STRICT);
94
95         $res = parent::factory($table);
96
97         // reset
98         error_reporting($old);
99         return $res;
100     }
101
102     public function get($k = null, $v = null)
103     {
104         // avoid those annoying PEAR::DB strict standards warnings it causes
105         $old = error_reporting();
106         error_reporting(error_reporting() & ~E_STRICT);
107
108         $res = parent::get($k, $v);
109
110         // reset
111         error_reporting($old);
112         return $res;
113     }
114
115     public function fetch()
116     {
117         // avoid those annoying PEAR::DB strict standards warnings it causes
118         $old = error_reporting();
119         error_reporting(error_reporting() & ~E_STRICT);
120
121         $res = parent::fetch();
122
123         // reset
124         error_reporting($old);
125         return $res;
126     }
127
128     public function find($n = false)
129     {
130         // avoid those annoying PEAR::DB strict standards warnings it causes
131         $old = error_reporting();
132         error_reporting(error_reporting() & ~E_STRICT);
133
134         $res = parent::find($n);
135
136         // reset
137         error_reporting($old);
138         return $res;
139     }
140
141     public function fetchRow($row = null)
142     {
143         // avoid those annoying PEAR::DB strict standards warnings it causes
144         $old = error_reporting();
145         error_reporting(error_reporting() & ~E_STRICT);
146
147         $res = parent::fetchRow($row);
148
149         // reset
150         error_reporting($old);
151         return $res;
152     }
153
154     // insert calls PEAR::isError from DB_DataObject, so let's make that disappear too
155     public function insert()
156     {
157         // avoid those annoying PEAR::DB strict standards warnings it causes
158         $old = error_reporting();
159         error_reporting(error_reporting() & ~E_STRICT);
160
161         $res = parent::insert();
162
163         // reset
164         error_reporting($old);
165         return $res;
166     }
167
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)
170     {
171         // avoid those annoying PEAR::DB strict standards warnings it causes
172         $old = error_reporting();
173         error_reporting(error_reporting() & ~E_STRICT);
174
175         $res = parent::joinAdd($obj, $joinType, $joinAs, $joinCol);
176
177         // reset
178         error_reporting($old);
179         return $res;
180     }
181
182     public function links()
183     {
184         // avoid those annoying PEAR::DB strict standards warnings it causes
185         $old = error_reporting();
186         error_reporting(error_reporting() & ~E_STRICT);
187
188         $res = parent::links();
189
190         // reset
191         error_reporting($old);
192         return $res;
193     }
194
195     // wraps the update call so we don't throw E_STRICT warnings during it
196     public function update($dataObject = false)
197     {
198         // avoid those annoying PEAR::DB strict standards warnings it causes
199         $old = error_reporting();
200         error_reporting(error_reporting() & ~E_STRICT);
201
202         $res = parent::update($dataObject);
203
204         // reset
205         error_reporting($old);
206         return $res;
207     }
208
209     static public function staticGet($class, $k, $v = null)
210     {
211         // avoid those annoying PEAR::DB strict standards warnings it causes
212         $old = error_reporting();
213         error_reporting(error_reporting() & ~E_STRICT);
214
215         $res = parent::staticGet($class, $k, $v);
216
217         // reset
218         error_reporting($old);
219         return $res;
220     }
221
222     public function staticGetAutoloadTable($table)
223     {
224         // avoid those annoying PEAR::DB strict standards warnings it causes
225         $old = error_reporting();
226         error_reporting(error_reporting() & ~E_STRICT);
227
228         $res = parent::staticGetAutoloadTable($table);
229
230         // reset
231         error_reporting($old);
232         return $res;
233     }
234 }