public function translateToRoleIds($roles)
    {
        if (!is_array($roles)) {
            if ($roles) {
                $roles = explode(",", $roles);
            } else {
                $roles = array();
            }
        }

        $lookup = array_flip($this->_roleTranslations);

        foreach ($roles as $key => $role) {
            if (isset($lookup[$role])) {
                $roles[$key] = $lookup[$role];
            }
        }

        return $roles;
    }
public function translateToRoleIds($roles)
    {
        if (!is_array($roles)) {
            if ($roles) {
                $roles = explode(",", $roles);
            } else {
                $roles = array();
            }
        }

        $lookup = array_flip($this->_roleTranslations);

        foreach ($roles as $key => $role) {
            if (isset($lookup[$role])) {
                $roles[$key] = $lookup[$role];
            }
        }

        return $roles;
    }
public function translateToRoleIds ( $ roles ) { if ( ! is_array ( $ roles ) ) { if ( $ roles ) { $ roles = explode ( "," , $ roles ) ; } else { $ roles = array ( ) ; } } $ lookup = array_flip ( $ this -> _roleTranslations ) ; foreach ( $ roles as $ key => $ role ) { if ( isset ( $ lookup [ $ role ] ) ) { $ roles [ $ key ] = $ lookup [ $ role ] ; } } return $ roles ; }
Translate all string role id's to numeric role ids

@param mixed $roles string or array
@return array Of role id's
Translate all string role id s to numeric role ids