Advertisement
bueddl

PHP OOP Database Class

Jul 29th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.04 KB | None | 0 0
  1. DB::table('test')
  2.     ->where('id', 1)
  3.     ->orWhere(function($query) {
  4.         $query->where('a', '>', 5)
  5.               ->where('a', '<=', 10);
  6.     })
  7.     ->delete();
  8.  
  9.    
  10. Table Object
  11. (
  12.     [m_impl:protected] => QueryImpl Object
  13.         (
  14.             [m_tableSql:QueryImpl:private] => `test`
  15.             [m_whereClauseSql:QueryImpl:private] =>
  16.             [m_offsetSql:QueryImpl:private] =>
  17.             [m_limitSql:QueryImpl:private] =>
  18.             [m_groupByClauseSql:QueryImpl:private] =>
  19.             [m_orderByClauseSql:QueryImpl:private] =>
  20.             [m_havingClauseSql:QueryImpl:private] =>
  21.             [m_variables:QueryImpl:private] => Array
  22.                 (
  23.                 )
  24.  
  25.         )
  26.  
  27. )
  28. Unknown2 Object
  29. (
  30.     [m_impl:protected] => QueryImpl Object
  31.         (
  32.             [m_tableSql:QueryImpl:private] => `test`
  33.             [m_whereClauseSql:QueryImpl:private] => `id` = ?
  34.             [m_offsetSql:QueryImpl:private] =>
  35.             [m_limitSql:QueryImpl:private] =>
  36.             [m_groupByClauseSql:QueryImpl:private] =>
  37.             [m_orderByClauseSql:QueryImpl:private] =>
  38.             [m_havingClauseSql:QueryImpl:private] =>
  39.             [m_variables:QueryImpl:private] => Array
  40.                 (
  41.                     [0] => 1
  42.                 )
  43.  
  44.         )
  45.  
  46. )
  47. Unknown2 Object
  48. (
  49.     [m_impl:protected] => QueryImpl Object
  50.         (
  51.             [m_tableSql:QueryImpl:private] => `test`
  52.             [m_whereClauseSql:QueryImpl:private] => `id` = ? OR (`a` > ? AND `a` <= ?)
  53.             [m_offsetSql:QueryImpl:private] =>
  54.             [m_limitSql:QueryImpl:private] =>
  55.             [m_groupByClauseSql:QueryImpl:private] =>
  56.             [m_orderByClauseSql:QueryImpl:private] =>
  57.             [m_havingClauseSql:QueryImpl:private] =>
  58.             [m_variables:QueryImpl:private] => Array
  59.                 (
  60.                     [0] => 1
  61.                     [1] => 5
  62.                     [2] => 10
  63.                 )
  64.  
  65.         )
  66.  
  67. )
  68. string(59) "DELETE FROM `test` WHERE `id` = ? OR (`a` > ? AND `a` <= ?)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement