NotificationTargetCommonITILObject::getLinkedGroupByType PHP Method

getLinkedGroupByType() public method

Add linked group to the notified user list
public getLinkedGroupByType ( $type )
$type type of linked groups
    function getLinkedGroupByType($type)
    {
        global $DB;
        $grouplinktable = getTableForItemType($this->obj->grouplinkclass);
        $fkfield = $this->obj->getForeignKeyField();
        //Look for the user by his id
        $query = "SELECT `groups_id`\n                FROM `{$grouplinktable}`\n                WHERE `{$grouplinktable}`.`{$fkfield}` = '" . $this->obj->fields["id"] . "'\n                      AND `{$grouplinktable}`.`type` = '{$type}'";
        foreach ($DB->request($query) as $data) {
            //Add the group in the notified users list
            $this->getAddressesByGroup(0, $data['groups_id']);
        }
    }