@@ 331-358 (lines=28) @@ | ||
328 | * @param bool $force |
|
329 | * @return bool|void |
|
330 | */ |
|
331 | public function delete(&$auction, $force = false) |
|
332 | { |
|
333 | if (strtolower(get_class($auction)) !== 'martinauction') { |
|
334 | return false; |
|
335 | } |
|
336 | ||
337 | $sql = "DELETE FROM " . $this->db->prefix("martin_auction") . " WHERE auction_id = " . $auction->auction_id(); |
|
338 | ||
339 | if (false != $force) { |
|
340 | $result = $this->db->queryF($sql); |
|
341 | } else { |
|
342 | $result = $this->db->query($sql); |
|
343 | } |
|
344 | ||
345 | $sql = "DELETE FROM " . $this->db->prefix("martin_auction_room") . " WHERE auction_id = " . $auction->auction_id(); |
|
346 | ||
347 | if (false != $force) { |
|
348 | $result = $this->db->queryF($sql); |
|
349 | } else { |
|
350 | $result = $this->db->query($sql); |
|
351 | } |
|
352 | ||
353 | if (!$result) { |
|
354 | return false; |
|
355 | } |
|
356 | ||
357 | return true; |
|
358 | } |
|
359 | ||
360 | /** |
|
361 | * delete hotel cities matching a set of conditions |
@@ 309-336 (lines=28) @@ | ||
306 | * @param bool $force |
|
307 | * @return bool|void |
|
308 | */ |
|
309 | public function delete(&$group, $force = false) |
|
310 | { |
|
311 | if (strtolower(get_class($group)) !== 'martingroup') { |
|
312 | return false; |
|
313 | } |
|
314 | ||
315 | $sql = "DELETE FROM " . $this->db->prefix("martin_group") . " WHERE group_id = " . $group->group_id(); |
|
316 | ||
317 | if (false != $force) { |
|
318 | $result = $this->db->queryF($sql); |
|
319 | } else { |
|
320 | $result = $this->db->query($sql); |
|
321 | } |
|
322 | ||
323 | $sql = "DELETE FROM " . $this->db->prefix("martin_group_room") . " WHERE group_id = " . $group->group_id(); |
|
324 | ||
325 | if (false != $force) { |
|
326 | $result = $this->db->queryF($sql); |
|
327 | } else { |
|
328 | $result = $this->db->query($sql); |
|
329 | } |
|
330 | ||
331 | if (!$result) { |
|
332 | return false; |
|
333 | } |
|
334 | ||
335 | return true; |
|
336 | } |
|
337 | ||
338 | /** |
|
339 | * delete hotel cities matching a set of conditions |