original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Translate all string role id's to numeric role ids
  
  @param mixed $roles string or array
  @return array Of role id's
docstring_tokens: Translate all string role id s to numeric role ids