public function printSQL() { $str = ''; if ($this->crit instanceof Criteria) { $str .= $this->crit->getSQL(); foreach ($this->crit->getValues() as $val) { if (!is_int($val)) { $val = '\'' . $val . '\''; } $str = substr_replace($str, $val, mb_strpos($str, '?'), 1); } } return $str; }
public function printSQL() { $str = ''; if ($this->getCriteria() instanceof Criteria) { $str .= $this->crit->getSQL(); foreach ($this->crit->getValues() as $val) { if (is_int($val)) { $val = $val; } elseif (is_null($val)) { $val = 'null'; } else { $val = '\'' . $val . '\''; } $str = substr_replace($str, $val, mb_strpos($str, '?'), 1); } } else { $str = $this->custom_sql; } return $str; }
$criteriaGenerate = new CriteriaGenerate($criteriaDBDefault); $criteriaGenerate->generateEntity(); listar_directorios_ruta(CRITERIA_PATH_RELATIVE . "generation"); break; case "CARGAR_PRUEBAS": echo "Cargando Pruebas"; require_once 'generation/EntityBecas.php'; // require_once 'generation/EntityArancel.php'; $criteria = new Criteria(); $becas = new EntityBecas(); $criteria->createCriteria($becas); $criteria->add(Restrictions::eq("beca_anio", "2011")); $criteria->add(Restrictions::between("beca_ID", 4, 9)); $criteria->addOrder(Order::desc("beca_ID")); //$criteria-> dprCriteria($criteria->getSQL()); $lol = $criteria->lista(); dprCriteria($lol); //$criteria->add($restrictions); // $filial = new EntityCCA_FILIAL(); // $filial->ID_FILIAL = 1; // $criteria->find($filial); // dpr($filial); // $filial->APLICACION_ACTUALIZACION = "PruebMerg2"; // $criteria->merge($filial); // $filial->ID_FILIAL = null; // $filial->APLICACION_ACTUALIZACION = "Persist"; // $criteria->persist($filial); // $criteria = new Criteria(); // $criteria->createCriteria(new EntityCCA_FILIAL()); // dpr($criteria->lista());