Exemple #1
0
 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;
 }
Exemple #2
0
 function get($IDCuidador)
 {
     $parametros = array();
     $parametros['IDCuidador'] = $IDCuidador;
     $this->bd->select($this->tabla, "*", "IDCuidador=:IDCuidador", $parametros);
     $fila = $this->bd->getRow();
     $cuidador = new Cuidador();
     $cuidador->set($fila);
     return $cuidador;
 }
 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;
 }