@@ -136,12 +136,7 @@ public function get($primary_value)
136
136
137
137
if ($ this ->soft_delete && $ this ->_temporary_with_deleted !== TRUE )
138
138
{
139
- $ this ->_database ->where ($ this ->soft_delete_key , FALSE );
140
- }
141
-
142
- if ($ this ->soft_delete && $ this ->_temporary_only_deleted )
143
- {
144
- $ this ->_database ->where ($ this ->soft_delete_key , TRUE );
139
+ $ this ->_database ->where ($ this ->soft_delete_key , (bool )$ this ->_temporary_only_deleted );
145
140
}
146
141
147
142
$ row = $ this ->_database ->where ($ this ->primary_key , $ primary_value )
@@ -166,12 +161,7 @@ public function get_by()
166
161
167
162
if ($ this ->soft_delete && $ this ->_temporary_with_deleted !== TRUE )
168
163
{
169
- $ this ->_database ->where ($ this ->soft_delete_key , FALSE );
170
- }
171
-
172
- if ($ this ->soft_delete && $ this ->_temporary_only_deleted )
173
- {
174
- $ this ->_database ->where ($ this ->soft_delete_key , TRUE );
164
+ $ this ->_database ->where ($ this ->soft_delete_key , (bool )$ this ->_temporary_only_deleted );
175
165
}
176
166
177
167
$ this ->trigger ('before_get ' );
@@ -193,12 +183,7 @@ public function get_many($values)
193
183
{
194
184
if ($ this ->soft_delete && $ this ->_temporary_with_deleted !== TRUE )
195
185
{
196
- $ this ->_database ->where ($ this ->soft_delete_key , FALSE );
197
- }
198
-
199
- if ($ this ->soft_delete && $ this ->_temporary_only_deleted )
200
- {
201
- $ this ->_database ->where ($ this ->soft_delete_key , TRUE );
186
+ $ this ->_database ->where ($ this ->soft_delete_key , (bool )$ this ->_temporary_only_deleted );
202
187
}
203
188
204
189
$ this ->_database ->where_in ($ this ->primary_key , $ values );
@@ -216,12 +201,7 @@ public function get_many_by()
216
201
217
202
if ($ this ->soft_delete && $ this ->_temporary_with_deleted !== TRUE )
218
203
{
219
- $ this ->_database ->where ($ this ->soft_delete_key , FALSE );
220
- }
221
-
222
- if ($ this ->soft_delete && $ this ->_temporary_only_deleted )
223
- {
224
- $ this ->_database ->where ($ this ->soft_delete_key , TRUE );
204
+ $ this ->_database ->where ($ this ->soft_delete_key , (bool )$ this ->_temporary_only_deleted );
225
205
}
226
206
227
207
return $ this ->get_all ();
@@ -234,17 +214,12 @@ public function get_many_by()
234
214
public function get_all ()
235
215
{
236
216
$ this ->trigger ('before_get ' );
237
-
217
+
238
218
if ($ this ->soft_delete && $ this ->_temporary_with_deleted !== TRUE )
239
219
{
240
- $ this ->_database ->where ($ this ->soft_delete_key , FALSE );
220
+ $ this ->_database ->where ($ this ->soft_delete_key , ( bool ) $ this -> _temporary_only_deleted );
241
221
}
242
222
243
- if ($ this ->soft_delete && $ this ->_temporary_only_deleted )
244
- {
245
- $ this ->_database ->where ($ this ->soft_delete_key , TRUE );
246
- }
247
-
248
223
$ result = $ this ->_database ->get ($ this ->_table )
249
224
->{$ this ->_return_type (1 )}();
250
225
$ this ->_temporary_return_type = $ this ->return_type ;
0 commit comments