Skip to content

Commit

Permalink
Merge pull request #11 from manuelj555/nuevo_dir
Browse files Browse the repository at this point in the history
nueva estructura de directorios y namespaces
  • Loading branch information
joanhey committed Mar 12, 2014
2 parents 58a0558 + 2a2e89a commit 32f847f
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord;
namespace Kumbia\ActiveRecord;

// @see LiteRecord
require_once __DIR__ . '/LiteRecord.php';
Expand Down
2 changes: 1 addition & 1 deletion Db.php → lib/Kumbia/ActiveRecord/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord;
namespace Kumbia\ActiveRecord;

use PDO;

Expand Down
2 changes: 1 addition & 1 deletion LiteRecord.php → lib/Kumbia/ActiveRecord/LiteRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord;
namespace Kumbia\ActiveRecord;

// @see Db
require_once __DIR__ . '/Db.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord\Metadata;
namespace Kumbia\ActiveRecord\Metadata;

/**
* Metadata de tabla
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord\Metadata;
namespace Kumbia\ActiveRecord\Metadata;

use Kumbia\ActiveRecord\Db;
use PDO;

/**
* Adaptador de Metadata para Mysql
Expand All @@ -40,13 +43,13 @@ class MysqlMetadata extends Metadata
protected function queryFields($database, $table, $schema = null)
{
if (!$schema) {
$describe = \ActiveRecord\Db::get($database)->query("DESCRIBE `$table`");
$describe = Db::get($database)->query("DESCRIBE `$table`");
} else {
$describe = \ActiveRecord\Db::get($database)->query("DESCRIBE `$schema`.`$table`");
$describe = Db::get($database)->query("DESCRIBE `$schema`.`$table`");
}

$fields = array();
while(( $value = $describe->fetch(\PDO::FETCH_OBJ))) {
while(( $value = $describe->fetch(PDO::FETCH_OBJ))) {
$fields[$value->Field] = array(
'Type' => $value->Type,
'Null' => $value->Null != 'NO',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord\Metadata;
namespace Kumbia\ActiveRecord\Metadata;

use Kumbia\ActiveRecord\Db;

/**
* Adaptador de Metadata para Pgsql
Expand All @@ -40,7 +42,7 @@ protected function queryFields($database, $table, $schema = null)
if(!$schema) $schema = 'public';

// Nota: Se excluyen claves compuestas
$describe = \ActiveRecord\Db::get($database)->query("
$describe = Db::get($database)->query("
SELECT DISTINCT
c.column_name AS field,
c.udt_name AS type,
Expand Down
2 changes: 1 addition & 1 deletion Paginator.php → lib/Kumbia/ActiveRecord/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord;
namespace Kumbia\ActiveRecord;

/**
* Implementación de paginador
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord\Query;
namespace Kumbia\ActiveRecord\Query;

/**
* Obtiene el último id generado en mysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord\Query;
namespace Kumbia\ActiveRecord\Query;

/**
* Adiciona limit y offset a la consulta sql en mysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord\Query;
namespace Kumbia\ActiveRecord\Query;

/**
* Obtiene el último id generado en pgsql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord\Query;
namespace Kumbia\ActiveRecord\Query;

/**
* Adiciona limit y offset a la consulta sql en pgsql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
*/

namespace ActiveRecord\Query;
namespace Kumbia\ActiveRecord\Query;

/**
* Ejecuta una consulta
Expand Down

0 comments on commit 32f847f

Please sign in to comment.