]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/GS_DataObject.php
2d196026a4af0857bcf181f71cf5f2c9b86efdf1
[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     static public function factory($table = '')
76     {
77         // avoid those annoying PEAR::DB strict standards warnings it causes
78         $old = error_reporting();
79         error_reporting(error_reporting() & ~E_STRICT);
80
81         $res = parent::factory($table);
82
83         // reset
84         error_reporting($old);
85         return $res;
86     }
87
88     public function get($k = null, $v = null)
89     {
90         // avoid those annoying PEAR::DB strict standards warnings it causes
91         $old = error_reporting();
92         error_reporting(error_reporting() & ~E_STRICT);
93
94         $res = parent::get($k, $v);
95
96         // reset
97         error_reporting($old);
98         return $res;
99     }
100
101     public function fetch()
102     {
103         // avoid those annoying PEAR::DB strict standards warnings it causes
104         $old = error_reporting();
105         error_reporting(error_reporting() & ~E_STRICT);
106
107         $res = parent::fetch();
108
109         // reset
110         error_reporting($old);
111         return $res;
112     }
113
114     public function find($n = false)
115     {
116         // avoid those annoying PEAR::DB strict standards warnings it causes
117         $old = error_reporting();
118         error_reporting(error_reporting() & ~E_STRICT);
119
120         $res = parent::find($n);
121
122         // reset
123         error_reporting($old);
124         return $res;
125     }
126
127     public function fetchRow($row = null)
128     {
129         // avoid those annoying PEAR::DB strict standards warnings it causes
130         $old = error_reporting();
131         error_reporting(error_reporting() & ~E_STRICT);
132
133         $res = parent::fetchRow($row);
134
135         // reset
136         error_reporting($old);
137         return $res;
138     }
139
140     // insert calls PEAR::isError from DB_DataObject, so let's make that disappear too
141     public function insert()
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::insert();
148
149         // reset
150         error_reporting($old);
151         return $res;
152     }
153
154     // DB_DataObject's joinAdd calls DB_DataObject::factory explicitly, so our factory-override doesn't work
155     public function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false)
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::joinAdd($obj, $joinType, $joinAs, $joinCol);
162
163         // reset
164         error_reporting($old);
165         return $res;
166     }
167
168     public function links()
169     {
170         // avoid those annoying PEAR::DB strict standards warnings it causes
171         $old = error_reporting();
172         error_reporting(error_reporting() & ~E_STRICT);
173
174         $res = parent::links();
175
176         // reset
177         error_reporting($old);
178         return $res;
179     }
180
181     // wraps the update call so we don't throw E_STRICT warnings during it
182     public function update($dataObject = false)
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::update($dataObject);
189
190         // reset
191         error_reporting($old);
192         return $res;
193     }
194
195     static public function staticGet($class, $k, $v = null)
196     {
197         // avoid those annoying PEAR::DB strict standards warnings it causes
198         $old = error_reporting();
199         error_reporting(error_reporting() & ~E_STRICT);
200
201         $res = parent::staticGet($class, $k, $v);
202
203         // reset
204         error_reporting($old);
205         return $res;
206     }
207
208     public function staticGetAutoloadTable($table)
209     {
210         // avoid those annoying PEAR::DB strict standards warnings it causes
211         $old = error_reporting();
212         error_reporting(error_reporting() & ~E_STRICT);
213
214         $res = parent::staticGetAutoloadTable($table);
215
216         // reset
217         error_reporting($old);
218         return $res;
219     }
220 }