Removed redundant functions, some Standardisation work
This commit is contained in:
@@ -44,21 +44,7 @@ class Model_Account extends lnApp_Model_Account {
|
||||
|
||||
/** REQUIRED ABSTRACT METHODS **/
|
||||
|
||||
/**
|
||||
* Returns the company name if it exists, otherwise the persons name
|
||||
*/
|
||||
public function name($variable=NULL) {
|
||||
return $this->isCompany() ? $this->company : $this->namesub();
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the persons name
|
||||
*/
|
||||
public function namesub($variable=NULL) {
|
||||
return trim(sprintf('%s %s',$this->first_name,$this->last_name));
|
||||
}
|
||||
|
||||
/** OTHER METHODS **/
|
||||
/** LOCAL METHODS **/
|
||||
|
||||
public function activated() {
|
||||
return $this->has('group');
|
||||
@@ -115,6 +101,20 @@ class Model_Account extends lnApp_Model_Account {
|
||||
return $this->RTM->loaded();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the company name if it exists, otherwise the persons name
|
||||
*/
|
||||
public function name($variable=NULL) {
|
||||
return $this->isCompany() ? $this->company : $this->namesub();
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the persons name
|
||||
*/
|
||||
public function namesub($variable=NULL) {
|
||||
return trim(sprintf('%s %s',$this->first_name,$this->last_name));
|
||||
}
|
||||
|
||||
/**
|
||||
* The key we use to sort entries of this model type
|
||||
*/
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Account_Log extends ORM_OSB {
|
||||
class Model_Account_Log extends ORM {
|
||||
protected $_belongs_to = array(
|
||||
'account'=>array(),
|
||||
);
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Country extends ORM_OSB {
|
||||
class Model_Country extends ORM {
|
||||
protected $_has_one = array(
|
||||
'currency'=>array('far_key'=>'id'),
|
||||
);
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Currency extends ORM_OSB {
|
||||
class Model_Currency extends ORM {
|
||||
protected $_sorting = array(
|
||||
'name'=>'ASC',
|
||||
);
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Group_Method extends ORM_OSB {
|
||||
class Model_Group_Method extends ORM {
|
||||
// Relationships
|
||||
protected $_has_one = array(
|
||||
'record_id'=>array(),
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Language extends ORM_OSB {
|
||||
class Model_Language extends ORM {
|
||||
protected $_sorting = array(
|
||||
'name'=>'ASC',
|
||||
);
|
||||
|
@@ -9,6 +9,6 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Log_Error extends ORM_OSB {
|
||||
class Model_Log_Error extends ORM {
|
||||
}
|
||||
?>
|
||||
|
@@ -12,7 +12,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Module extends ORM_OSB {
|
||||
class Model_Module extends ORM {
|
||||
// Relationships
|
||||
protected $_has_one = array(
|
||||
'record_id'=>array('model'=>'Record_ID','far_key'=>'id'),
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Module_Method extends ORM_OSB {
|
||||
class Model_Module_Method extends ORM {
|
||||
// This module doesnt keep track of column updates automatically
|
||||
protected $_created_column = FALSE;
|
||||
protected $_updated_column = FALSE;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Module_Method_Token extends ORM_OSB {
|
||||
class Model_Module_Method_Token extends ORM {
|
||||
// This module doesnt keep track of column updates automatically
|
||||
protected $_updated_column = FALSE;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_RTM extends ORM_OSB {
|
||||
class Model_RTM extends ORM {
|
||||
protected $_belongs_to = array(
|
||||
'account' => array(),
|
||||
);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Record_ID extends ORM_OSB {
|
||||
class Model_Record_ID extends ORM {
|
||||
protected $_primary_key = 'module_id';
|
||||
|
||||
// This module doesnt keep track of column updates automatically
|
||||
|
@@ -12,7 +12,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Setup extends ORM_OSB {
|
||||
class Model_Setup extends ORM {
|
||||
// Setup doesnt use the update column
|
||||
protected $_updated_column = FALSE;
|
||||
|
||||
|
Reference in New Issue
Block a user