DBNone.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /**
  3. * This file is part of the Propel package.
  4. * For the full copyright and license information, please view the LICENSE
  5. * file that was distributed with this source code.
  6. *
  7. * @license MIT License
  8. */
  9. /**
  10. * This adapter is used when you do not have a database installed.
  11. *
  12. * @author Hans Lellelid <hans@xmpl.org> (Propel)
  13. * @author Jon S. Stevens <jon@clearink.com> (Torque)
  14. * @author Brett McLaughlin <bmclaugh@algx.net> (Torque)
  15. * @version $Revision: 1612 $
  16. * @package propel.runtime.adapter
  17. */
  18. class DBNone extends DBAdapter
  19. {
  20. /**
  21. * @see DBAdapter::initConnection()
  22. */
  23. public function initConnection(PDO $con, array $settings)
  24. {
  25. }
  26. /**
  27. * This method is used to ignore case.
  28. *
  29. * @param in The string to transform to upper case.
  30. * @return The upper case string.
  31. */
  32. public function toUpperCase($in)
  33. {
  34. return $in;
  35. }
  36. /**
  37. * This method is used to ignore case.
  38. *
  39. * @param in The string whose case to ignore.
  40. * @return The string in a case that can be ignored.
  41. */
  42. public function ignoreCase($in)
  43. {
  44. return $in;
  45. }
  46. /**
  47. * Returns SQL which concatenates the second string to the first.
  48. *
  49. * @param string String to concatenate.
  50. * @param string String to append.
  51. * @return string
  52. */
  53. public function concatString($s1, $s2)
  54. {
  55. return ($s1 . $s2);
  56. }
  57. /**
  58. * Returns SQL which extracts a substring.
  59. *
  60. * @param string String to extract from.
  61. * @param int Offset to start from.
  62. * @param int Number of characters to extract.
  63. * @return string
  64. */
  65. public function subString($s, $pos, $len)
  66. {
  67. return substr($s, $pos, $len);
  68. }
  69. /**
  70. * Returns SQL which calculates the length (in chars) of a string.
  71. *
  72. * @param string String to calculate length of.
  73. * @return string
  74. */
  75. public function strLength($s)
  76. {
  77. return strlen($s);
  78. }
  79. /**
  80. * Modifies the passed-in SQL to add LIMIT and/or OFFSET.
  81. */
  82. public function applyLimit(&$sql, $offset, $limit)
  83. {
  84. }
  85. /**
  86. * Gets the SQL string that this adapter uses for getting a random number.
  87. *
  88. * @param mixed $seed (optional) seed value for databases that support this
  89. */
  90. public function random($seed = null)
  91. {
  92. }
  93. }