configure Tlog and TlogFile

This commit is contained in:
Manuel Raynaud
2012-12-27 18:05:50 +01:00
parent e74752cc3a
commit f5493f86af
14 changed files with 624 additions and 201 deletions

View File

@@ -22,6 +22,10 @@
/*************************************************************************************/
namespace Thelia\Database;
use Thelia\Log\TlogInterface;
use Thelia\Database\NotORM\Result;
/**
*
* Class Thelia\Database\NotORM extending \NotORM library http://www.notorm.com/
@@ -33,11 +37,18 @@ namespace Thelia\Database;
class NotORM extends \NotORM
{
public $logger = false;
public function setCache(\NotORM_Cache $cache)
{
$this->cache = $cache;
}
public function setLogger(TlogInterface $logger)
{
$this->logger = $logger;
}
public function setDebug($debug)
{
if(is_callable($debug))
@@ -47,4 +58,17 @@ class NotORM extends \NotORM
$this->debug = true;
}
}
/** Get table data
* @param string
* @param array (["condition"[, array("value")]]) passed to NotORM_Result::where()
* @return NotORM_Result
*/
function __call($table, array $where) {
$return = new Result($this->structure->getReferencingTable($table, ''), $this);
if ($where) {
call_user_func_array(array($return, 'where'), $where);
}
return $return;
}
}