Skip to content

Commit

Permalink
Dev: added "getParentTitle" method, to check if group has a parent be…
Browse files Browse the repository at this point in the history
…fore calling the relation
  • Loading branch information
LouisGac committed Jul 24, 2017
1 parent e633724 commit 83b5f5f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions application/models/SurveysGroups.php
Expand Up @@ -110,6 +110,16 @@ public function search()
));
}

public function getParentTitle()
{
// "(gsid: ".$data->parent_id.")"." ".$data->parentgroup->title,
if (empty($this->parent_id)){
return "";
}else{
return $this->parentgroup->title;
}
}

/**
* Returns the static model of the specified AR class.
* Please note that you should have this exact method in all your CActiveRecord descendants!
Expand Down

0 comments on commit 83b5f5f

Please sign in to comment.