123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
-
- /**
- * AUTO GENERATED BY LUTICATE GENERATOR
- * ANY CHANGES WILL BE OVERWRITTEN
- */
-
- namespace App\Http\DataAccess\SP;
-
- use Luticate\Utils\LuSpDbo;
- use Luticate\Utils\LuMultipleDbo;
- use Luticate\Utils\LuStringUtils;
- use Illuminate\Support\Facades\DB;
-
- class SpSearch extends LuSpDbo {
-
- /**
- * @param $dam
- * @return \App\Http\DataAccess\SP\SpSearch|null
- */
- protected static function damToDbo($dam)
- {
- if (is_null($dam))
- return null;
- $dbo = new SpSearch();
-
- $dbo->setRes(LuStringUtils::convertJsonString($dam->_res));
-
- return $dbo;
- }
-
-
- /**
- * @param $_text string
- * @param $_query string
- * @return \App\Http\DataAccess\SP\SpSearch;
- */
- public static function execute($_text, $_query)
- {
- $values = DB::select('SELECT to_json(data._res) AS _res FROM sp_search(:_text, :_query) data', array(":_text" => $_text, ":_query" => $_query));
- return self::damToDbo($values[0]);
- }
-
-
- public function jsonSerialize()
- {
- return array(
- "Res" => $this->_Res
- );
- }
-
- public static function jsonDeserialize($json)
- {
- $dbo = new SpSearch();
- if (isset($json["Res"])) {
- $dbo->setRes($json["Res"]);
- }
- return $dbo;
- }
-
- public static function generateSample()
- {
- $dbo = new SpSearch();
- $dbo->setRes(true);
- return $dbo;
- }
-
-
- /**
- * @var boolean
- */
- protected $_Res;
- public function getRes()
- {
- return $this->_Res;
- }
- public function setRes($value)
- {
- $this->_Res = $value;
- }
- }
|