12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- {{ "<?php" }}
-
- /**
- * AUTO GENERATED BY LUTICATE GENERATOR
- * ANY CHANGES WILL BE OVERWRITTEN
- */
-
- namespace {{ sp_namespace.as_it }};
-
- use Luticate\Utils\LuSpModel;
- use Illuminate\Support\Facades\DB;
-
- class {{ sp.sp_name.camel_upper }} extends LuSpModel {
-
- protected static function damToDbo($dam)
- {
- if (is_null($dam))
- return null;
- $dbo = new {{ sp.sp_name.camel_upper }}();
-
- {% for arg in args.out %}
- $dbo->set{{ arg.name.camel_upper }}($dam->{{ arg.name.as_it }});
- {% endfor %}
-
- return $dbo;
- }
-
- public static function execute({% for arg in args.in %}${{ arg.name.as_it }}{{ loop.last ? "" : ", " }}{% endfor %})
- {
- $values = DB::select('SELECT * FROM {{ sp.sp_name.as_it }}({% for arg in args.in %}?{{ loop.last ? "" : ", " }}{% endfor %})', array({% for arg in args.in %}${{ arg.name.as_it }}{{ loop.last ? "" : ", " }}{% endfor %}));
- {% if sp.proretset %}
- $dboValues = array();
- foreach ($values as $value)
- $dboValues[] = self::damToDbo($value);
- return $dboValues;
- {% else %}
- return self::damToDbo($values[0]);
- {% endif %}
- }
- {% for arg in args.out %}
-
- /**
- * @var {{ arg.data_type.php.as_it }}
- */
- protected $_{{ arg.name.camel_lower }};
- public function get{{ arg.name.camel_upper }}()
- {
- return $this->_{{ arg.name.camel_lower }};
- }
- public function set{{ arg.name.camel_upper }}($value)
- {
- $this->_{{ arg.name.camel_lower }} = $value;
- }
- {% endfor %}
- }
|