]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/GS_DataObject.php
joinAdd calls DB_DataObject::factory directly so no GS_DataObject override
[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     // DB_DataObject's joinAdd calls DB_DataObject::factory explicitly, so our factory-override doesn't work
141     public function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false)
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::joinAdd($obj, $joinType, $joinAs, $joinCol);
148
149         // reset
150         error_reporting($old);
151         return $res;
152     }
153
154     public function links()
155     {
156         // avoid those annoying PEAR::DB strict standards warnings it causes
157         $old = error_reporting();
158         error_reporting(error_reporting() & ~E_STRICT);
159
160         $res = parent::links();
161
162         // reset
163         error_reporting($old);
164         return $res;
165     }
166
167     // wraps the update call so we don't throw E_STRICT warnings during it
168     public function update($dataObject = false)
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::update($dataObject);
175
176         // reset
177         error_reporting($old);
178         return $res;
179     }
180
181     static public function staticGet($class, $k, $v = null)
182     {
183         // avoid those annoying PEAR::DB strict standards warnings it causes
184         $old = error_reporting();
185         error_reporting(error_reporting() & ~E_STRICT);
186
187         $res = parent::staticGet($class, $k, $v);
188
189         // reset
190         error_reporting($old);
191         return $res;
192     }
193
194     public function staticGetAutoloadTable($table)
195     {
196         // avoid those annoying PEAR::DB strict standards warnings it causes
197         $old = error_reporting();
198         error_reporting(error_reporting() & ~E_STRICT);
199
200         $res = parent::staticGetAutoloadTable($table);
201
202         // reset
203         error_reporting($old);
204         return $res;
205     }
206 }