You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Unaccent.php 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * AUTO GENERATED BY LUTICATE GENERATOR
  4. * ANY CHANGES WILL BE OVERWRITTEN
  5. */
  6. namespace App\Http\DataAccess\SP;
  7. use Luticate\Utils\LuSpDbo;
  8. use Luticate\Utils\LuMultipleDbo;
  9. use Luticate\Utils\LuStringUtils;
  10. use Illuminate\Support\Facades\DB;
  11. class Unaccent extends LuSpDbo {
  12. /**
  13. * @param $dam
  14. * @return \App\Http\DataAccess\SP\Unaccent|null
  15. */
  16. protected static function damToDbo($dam)
  17. {
  18. if (is_null($dam))
  19. return null;
  20. $dbo = new Unaccent();
  21. $dbo->setUnaccent(LuStringUtils::convertJsonString($dam->unaccent));
  22. return $dbo;
  23. }
  24. /**
  25. * @param $ regdictionary
  26. * @param $ text
  27. * @param $ text
  28. * @return \App\Http\DataAccess\SP\Unaccent;
  29. */
  30. public static function execute($, $, $)
  31. {
  32. $values = DB::select('SELECT to_json(data.unaccent) AS unaccent FROM unaccent(:, :, :) data', array(":" => $, ":" => $, ":" => $));
  33. return self::damToDbo($values[0]);
  34. }
  35. public function jsonSerialize()
  36. {
  37. return array(
  38. "Unaccent" => $this->_unaccent
  39. );
  40. }
  41. public static function jsonDeserialize($json)
  42. {
  43. $dbo = new Unaccent();
  44. if (isset($json["Unaccent"])) {
  45. $dbo->setUnaccent($json["Unaccent"]);
  46. }
  47. return $dbo;
  48. }
  49. public static function generateSample()
  50. {
  51. $dbo = new Unaccent();
  52. $dbo->setUnaccent("sample string");
  53. return $dbo;
  54. }
  55. /**
  56. * @var text
  57. */
  58. protected $_unaccent;
  59. public function getUnaccent()
  60. {
  61. return $this->_unaccent;
  62. }
  63. public function setUnaccent($value)
  64. {
  65. $this->_unaccent = $value;
  66. }
  67. }