| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
$nextGroup = $this->_getNextSiblingGroup($currentGroup);
if (!$nextGroup) {
// no sibling, find an ancestor w/ a sibling
- for (; ;) {
+ for (;;) {
// since we pop this array everytime, we should be
// reasonably safe from infinite loops, I think :)
$ancestor = array_pop($this->_parentStack);
}
else {
/* if we get here, it could be because we're out of siblings
- * (in which case we return null) or because we're at the
- * top level groups which do not have parents but may still
- * have siblings, so check for that first.
- */
+ * (in which case we return null) or because we're at the
+ * top level groups which do not have parents but may still
+ * have siblings, so check for that first.
+ */
$nextGroup = $this->_getNextParentlessGroup($group);
if ($nextGroup) {
* @param $childID
* The child id of the association.
*
- * @return boolean
+ * @return bool
* True if association is found, false otherwise.
*/
public static function isParentChild($parentID, $childID) {
* @param $groupId
* The id of the group to check for child groups.
*
- * @return boolean
+ * @return bool
* True if 1 or more child groups are found, false otherwise.
*/
public static function hasChildGroups($groupId) {
* @param $groupId
* The id of the group to check for parent groups.
*
- * @return boolean
+ * @return bool
* True if 1 or more parent groups are found, false otherwise.
*/
public static function hasParentGroups($groupId) {
* @param $checkGroupId
* The group id to check if it is a parent of the $groupIds group(s).
*
- * @return boolean
+ * @return bool
* True if $checkGroupId points to a group that is a parent of one of the $groupIds groups, false otherwise.
*/
public static function isParentGroup($groupIds, $checkGroupId) {
$parentGroupId = $dao->parent_group_id;
if ($parentGroupId == $checkGroupId) {
/* print "One of these: <pre>";
- print_r($groupIds);
- print "</pre> has groupId $checkGroupId as an ancestor.<br/>"; */
+ print_r($groupIds);
+ print "</pre> has groupId $checkGroupId as an ancestor.<br/>"; */
return TRUE;
}
* @param $checkGroupId
* The group id to check if it is a child of the $groupIds group(s).
*
- * @return boolean
+ * @return bool
* True if $checkGroupId points to a group that is a child of one of the $groupIds groups, false otherwise.
*/
public static function isChildGroup($groupIds, $checkGroupId) {
$childGroupId = $dao->child_group_id;
if ($childGroupId == $checkGroupId) {
/* print "One of these: <pre>";
- print_r($groupIds);
- print "</pre> has groupId $checkGroupId as a descendent.<br/><br/>"; */
+ print_r($groupIds);
+ print "</pre> has groupId $checkGroupId as a descendent.<br/><br/>"; */
return TRUE;
}
* @param $checkGroupId
* The group id to check if it is an ancestor of the $groupIds group(s).
*
- * @return boolean
+ * @return bool
* True if $checkGroupId points to a group that is an ancestor of one of the $groupIds groups, false otherwise.
*/
public static function isAncestorGroup($groupIds, $checkGroupId) {
$parentGroupId = $dao->parent_group_id;
if ($parentGroupId == $checkGroupId) {
/* print "One of these: <pre>";
- print_r($groupIds);
- print "</pre> has groupId $checkGroupId as an ancestor.<br/>"; */
+ print_r($groupIds);
+ print "</pre> has groupId $checkGroupId as an ancestor.<br/>"; */
return TRUE;
}
* @param $checkGroupId
* The group id to check if it is a descendent of the $groupIds group(s).
*
- * @return boolean
+ * @return bool
* True if $checkGroupId points to a group that is a descendent of one of the $groupIds groups, false otherwise.
*/
public static function isDescendentGroup($groupIds, $checkGroupId) {
$childGroupId = $dao->child_group_id;
if ($childGroupId == $checkGroupId) {
/* print "One of these: <pre>";
- print_r($groupIds);
- print "</pre> has groupId $checkGroupId as a descendent.<br/><br/>"; */
+ print_r($groupIds);
+ print "</pre> has groupId $checkGroupId as a descendent.<br/><br/>"; */
return TRUE;
}
return $containingGroups;
}
+
}