Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nueva estructura de directorios y namespaces #11

Merged
merged 1 commit into from
Mar 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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