Replace status with active in tables
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user