Replace status with active in tables

This commit is contained in:
Deon George
2016-08-31 15:03:09 +10:00
parent 34e1e40f04
commit 54e4425aa8
51 changed files with 95 additions and 159 deletions

View File

@@ -45,13 +45,6 @@ abstract class ORM extends lnApp_ORM {
return parent::_build($type);
}
/**
* Function help to find records that are active
*/
final protected function _where_active() {
return $this->where('status','=',TRUE);
}
/**
* Determine if the account is authoised by the user
*/
@@ -188,13 +181,23 @@ abstract class ORM extends lnApp_ORM {
* Function help to find records that are active
*/
final public function list_active($active=TRUE) {
$x=($active ? $this->_where_active() : $this);
$x=($active ? $this->where_active() : $this);
return $x->find_all();
}
/**
* Function help to find records that are active
*/
final public function where_active() {
return $this->_where_active();
return $this->where($this->_table_name.'.active','=',TRUE);
}
/**
* Function help to find records that are inactive
*/
final public function where_inactive() {
return $this->where_open()->where($this->_table_name.'.active','=',FALSE)->or_where($this->_table_name.'.active','IS',NULL)->where_close();
}
// @todo This function shouldnt be here.