function getListCountryCityCountryLanguage($condicion = null, $parametros = array()) { if ($condicion === null) { $condicion = ""; } else { $condicion = "where {$condicion}"; } $sql = " select co.*, ci.*, cl.*\r\n from country co\r\n left join city ci\r\n on co.Code = ci.CountryCode\r\n left join countrylanguage cl \r\n on co.Code = cl.CountryCode {$condicion}"; $this->bd->send($sql, $parametros); $r = array(); $contador = 0; while ($fila = $this->bd->getRow()) { $country = new Cuidador(); $country->set($fila); $city = new Animal(); $city->set($fila, 15); //el numero es a partir del ultimo campo de country, para que coja los de city //$countrylanguage = new CountryLanguage(); //$countrylanguage->set($fila, 20); $r[$contador]["country"] = $country; $r[$contador]["city"] = $city; //$r[$contador]["countrylanguage"]=$countrylanguage; $contador++; } return $r; }
function getList($pagina = 1, $orden = "", $nrpp = Constant::NRPP) { $ordenPredeterminado = "{$orden}, NombreAnimal, ZonaCode, IDAnimal"; if ($orden === "" || $orden === null) { $ordenPredeterminado = "NombreAnimal, ZonaCode, IDAnimal"; } $registroInicial = ($pagina - 1) * $nrpp; $this->bd->select($this->tabla, "*", "1=1", array(), $ordenPredeterminado, "{$registroInicial}, {$nrpp}"); $r = array(); while ($fila = $this->bd->getRow()) { $animal = new Animal(); $animal->set($fila); $r[] = $animal; } return $r; }
function getListCountryCityCountryLanguage($condicion = null, $parametros = array()) { if ($condicion === null) { $condicion = ""; } else { $condicion = "where {$condicion}"; } $sql = " select co.*, ci.*, cl.*\r\n from country co\r\n left join city ci\r\n on co.Code = ci.CountryCode\r\n left join countrylanguage cl \r\n on co.Code = cl.CountryCode {$condicion}"; $this->bd->send($sql, $parametros); $r = array(); while ($fila = $this->bd->getRow()) { $country = new Cuidador(); $country->set($fila); $city = new Animal(); $city->set($fila, 15); $countrylanguage = new CountryLanguage(); $countrylanguage->set($fila, 20); $r[] = new CountryCityCountryLanguage($country, $city, $countrylanguage); } return $r; }