More initial work

This commit is contained in:
Deon George
2014-09-01 23:01:01 +10:00
parent febaad9ea6
commit 2115c70db0
14 changed files with 570 additions and 6 deletions

View File

@@ -154,19 +154,19 @@ abstract class ORM extends lnApp_ORM {
* Function help to find records that are active
*/
public function list_active($active=TRUE) {
$x=($active ? $this->_where_active() : $this);
$x=($active ? $this->where_active() : $this);
return $x->find_all();
}
public function list_count($active=TRUE) {
$x=($active ? $this->_where_active() : $this);
$x=($active ? $this->where_active() : $this);
return $x->find_all()->count();
}
public function where_active() {
return $this->where('active','=',TRUE);
return $this->where($this->_table_name.'.active','=',TRUE);
}
public function where_authorised(Model_Account $ao=NULL,$aid='account_id') {