src/Security/Group.php
protected function identifierToGroupID($groupID)
    {
        if (is_numeric($groupID) && Group::get()->byID($groupID)) {
            return $groupID;
        } elseif (is_string($groupID) && $groupByCode = Group::get()->filter(['Code' => $groupID])->first()) {
            return $groupByCode->ID;
        } elseif ($groupID instanceof Group && $groupID->exists()) {
            return $groupID->ID;
        }
        return null;
    }
protected function identifierToGroupID($groupID)
    {
        if (is_numeric($groupID) && Group::get()->byID($groupID)) {
            return $groupID;
        } elseif (is_string($groupID) && $groupByCode = Group::get()->filter(['Code' => $groupID])->first()) {
            return $groupByCode->ID;
        } elseif ($groupID instanceof Group && $groupID->exists()) {
            return $groupID->ID;
        }
        return null;
    }
protected function identifierToGroupID ( $ groupID ) { if ( is_numeric ( $ groupID ) && Group :: get ( ) -> byID ( $ groupID ) ) { return $ groupID ; } elseif ( is_string ( $ groupID ) && $ groupByCode = Group :: get ( ) -> filter ( [ 'Code' => $ groupID ] ) -> first ( ) ) { return $ groupByCode -> ID ; } elseif ( $ groupID instanceof Group && $ groupID -> exists ( ) ) { return $ groupID -> ID ; } return null ; }
Turn a string|int|Group into a GroupID

@param string|int|Group $groupID Group instance, Group Code or ID
@return int|null the Group ID or NULL if not found
Turn a string|int|Group into a GroupID