Misc fixes from live site
This commit is contained in:
@@ -65,6 +65,13 @@ abstract class ORM extends Kohana_ORM {
|
||||
return $this->where('status','=',TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Kohana cache so that it can be globally disabled.
|
||||
*/
|
||||
public function cached($lifetime=NULL) {
|
||||
return $this->_db->caching() ? parent::cached($lifetime) : $this;
|
||||
}
|
||||
|
||||
public function clear() {
|
||||
$this->_formated = FALSE;
|
||||
$this->_object_formated = array();
|
||||
@@ -151,7 +158,7 @@ abstract class ORM extends Kohana_ORM {
|
||||
$query->and_where($k,$s,$v);
|
||||
}
|
||||
|
||||
$c = 0;
|
||||
$c = 0;
|
||||
foreach ((empty($options['object']) ? $query->find_all() : $query->execute()) as $o) {
|
||||
// If we got here via a DB query, we need to reload our ORM object from the result.
|
||||
if (! is_object($o)) {
|
||||
@@ -174,7 +181,7 @@ abstract class ORM extends Kohana_ORM {
|
||||
}
|
||||
|
||||
$k = '';
|
||||
foreach ($label as $k => $details)
|
||||
foreach ($label as $k => $details)
|
||||
foreach ($details as $lvalue)
|
||||
$k = preg_replace('/%s/',$o->resolve($lvalue),$k,1);
|
||||
|
||||
|
Reference in New Issue
Block a user