~desarrollokumbia/kumbia/ActiveRecord

« back to all changes in this revision

Viewing changes to db_pool/db_pool.php

  • Committer: Deivinson Tejeda
  • Date: 2010-01-24 20:53:08 UTC
  • Revision ID: deivinsontejeda@gmail.com-20100124205308-hsovf0apo3pbg3s0
Mejorando el chain where, quedan ahora los metodos where() y whereOr y se puede concatenar los where, ademas se crea un método interno para el DbQuery quien ira armando el los where en el orden como se vayan llamando y para dejar mas facil el where y whereOr solo reciben string asi no liamos a los usarios con array, sin embargo seguimos evaluando
Eje...
    public function consulta()
    {
        $this->get()->where('id < :id2')
                    ->where('id > :id')
                    ->bind(array(':id'=>2, ':id2'=>5));
        return $this->find();
    }
la consulta generada del anterios chain es:
SELECT * FROM prueba WHERE  (id < :id2)  AND (id > :id)

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
        $config = $databases[$connection];
73
73
                
74
74
                // carga los valores por defecto para la conexion
75
 
                $default = array ('port' => 0, 'dbname' => NULL, 'host' => 'localhost', 'username' => NULL, 'password' => NULL);
 
75
                $default = array ('port' => 0, 'dbname' => NULL, 'host' => 'localhost', 'username' => NULL, 'pasword' => NULL);
76
76
                $config = $config + $default;
77
77
 
78
78
        try {