{% if tipo is same as("TABLA") or tipo is same as("VISTA") %} public function __construct($year=null, $bd=null) { {% include "MapearBaseDatos/Includes/Tabla.html.twig" %} $this->keystableKer=array({% for key, clave in claves %}{% if key > 0 %},'{{ clave|upper|trim }}'{% else %}'{{ clave|upper }}'{% endif %}{% endfor %}); {% include "MapearBaseDatos/Includes/Conexiones.html.twig" %} } {% elseif tipo is same as("PROCEDIMIENTO") %} {% set esta = false %} {% set variables = "" %} {% set tipos = "" %} {% for campo in campos %} {% if campo.esFinal == 1 %} {% set esta = true %} {% endif %} {% if esta == false %} {% if tipo matches '{^(INTEGER|SMALLINT|DOUBLE|FLOAT)}' %} {% set porc = "%s" %} {% else %} {% set porc = "%d" %} {% endif %} {% if variables == "" %} {% set tipos = tipos~porc %} {% set variables = variables~"$"~campo.nombreCampoSinFormato %} {% else %} {% set tipos = tipos~","~porc %} {% set variables = variables~","~"$"~campo.nombreCampoSinFormato %} {% endif %} {% endif %} {% endfor %} public function __construct( {% for atributo in atributos %} {{ atributo }} , {% endfor %}$year=null, $bd=null) { {% include "MapearBaseDatos/Includes/Tabla.html.twig" %} {% include "MapearBaseDatos/Includes/Conexiones.html.twig" %} $sql=sprintf("SELECT * FROM {{ tabla|upper }}({% for atributo in atributos %} {% if atributo != atributos|last %}%d, {% else %}%d{% endif %} {% endfor %})",{% for atributo in atributos %} {% if atributo != atributos|last %}{{atributo}}, {% else %}{{atributo}}{% endif %} {% endfor %}); $result = $this->obConn->ejecutar($sql, $this->conn, 0); if ($this->testRTSQL($result,'RESULTADO')==true){ $this->hidrateObject($result[0]); $this->setExist(true); }else{ $this->setExist(false); } } {% endif %}