Consistent use of return , payment refund handling

This commit is contained in:
Deon George
2013-04-05 23:50:08 +11:00
parent 43dfd88bce
commit 52d9005b64
30 changed files with 255 additions and 210 deletions

View File

@@ -42,21 +42,21 @@ class Model_Group extends Model_Auth_RoleDefault {
* are also related to this group, in the group heirarchy.
*/
public function list_childgrps($incParent=FALSE) {
$return = array();
$result = array();
if (! $this->loaded())
return $return;
return $result;
foreach (ORM::factory('Group')->where_active()->and_where('parent_id','=',$this)->find_all() as $go) {
array_push($return,$go);
array_push($result,$go);
$return = array_merge($return,$go->list_childgrps());
$result = array_merge($result,$go->list_childgrps());
}
if ($incParent)
array_push($return,$this);
array_push($result,$this);
return $return;
return $result;
}
/**
@@ -64,21 +64,21 @@ class Model_Group extends Model_Auth_RoleDefault {
* are also related to this group, in the group heirarchy.
*/
public function list_parentgrps($incParent=FALSE) {
$return = array();
$result = array();
if (! $this->loaded())
return $return;
return $result;
foreach (ORM::factory('Group')->where_active()->and_where('id','=',$this->parent_id)->find_all() as $go) {
array_push($return,$go);
array_push($result,$go);
$return = array_merge($return,$go->list_parentgrps());
$result = array_merge($result,$go->list_parentgrps());
}
if ($incParent)
array_push($return,$this);
array_push($result,$this);
return $return;
return $result;
}
}
?>