Criteriocustom
De CidesaWiki
(Diferencias entre revisiones)
(New page: public function getDes_pro() { // funcion custom $c = new Criteria; //creamos la sentencia auxiliar $this->campo = "caprovee.CODPRO=(Select codpro from caordcom where codpro=r...) |
|||
| Línea 1: | Línea 1: | ||
| - | public function | + | La funion lo |
| + | |||
| + | <pre> | ||
| + | public function getFuncion() | ||
{ | { | ||
// funcion custom | // funcion custom | ||
$c = new Criteria; | $c = new Criteria; | ||
//creamos la sentencia auxiliar | //creamos la sentencia auxiliar | ||
| - | $this-> | + | $this->sql = "Tabla.Campo=(Select * from tabla_name where campo=rpad('".$this->tabla->getOtro_campo()."',10,' '))"; |
| - | $c->add( | + | $c->add(TablaPeer::Campo, $this->sql, Criteria::CUSTOM); |
| - | $this-> | + | $this->rs= TablaPeer::doSelect($c); |
//Hacer Validacion del nompro | //Hacer Validacion del nompro | ||
} | } | ||
| + | nota: Tabla.Campo Pertenece TablaPeer osea quedaria en sql | ||
| + | |||
| + | SELECT * FROM Tabla WHERE Tabla.Campo=(Select campo from tabla_name where campo=rpad('".$this->tabla->getOtro_campo()."',10,' '))"; | ||
| + | |||
| + | </pre> | ||
Revisión de 19:01 23 mar 2007
La funion lo
public function getFuncion()
{
// funcion custom
$c = new Criteria;
//creamos la sentencia auxiliar
$this->sql = "Tabla.Campo=(Select * from tabla_name where campo=rpad('".$this->tabla->getOtro_campo()."',10,' '))";
$c->add(TablaPeer::Campo, $this->sql, Criteria::CUSTOM);
$this->rs= TablaPeer::doSelect($c);
//Hacer Validacion del nompro
}
nota: Tabla.Campo Pertenece TablaPeer osea quedaria en sql
SELECT * FROM Tabla WHERE Tabla.Campo=(Select campo from tabla_name where campo=rpad('".$this->tabla->getOtro_campo()."',10,' '))";