original_string: public function roleId(array $values)
      {
          $count = count($values);
          $ids = array_filter($values, 'ctype_digit');
  
          if ($count != count($ids)) {
              return $this->translation->text('@field has invalid value', array(
                  '@field' => $this->translation->text('Condition')));
          }
  
          $exists = array_filter($values, function ($role_id) {
  
              if ($role_id == 0) {
                  return true;
              }
  
              $role = $this->role->get($role_id);
              return isset($role['role_id']);
          });
  
          if ($count != count($exists)) {
              return $this->translation->text('@name is unavailable', array(
                  '@name' => $this->translation->text('Role')));
          }
  
          return true;
      }
code: public function roleId(array $values)
      {
          $count = count($values);
          $ids = array_filter($values, 'ctype_digit');
  
          if ($count != count($ids)) {
              return $this->translation->text('@field has invalid value', array(
                  '@field' => $this->translation->text('Condition')));
          }
  
          $exists = array_filter($values, function ($role_id) {
  
              if ($role_id == 0) {
                  return true;
              }
  
              $role = $this->role->get($role_id);
              return isset($role['role_id']);
          });
  
          if ($count != count($exists)) {
              return $this->translation->text('@name is unavailable', array(
                  '@name' => $this->translation->text('Role')));
          }
  
          return true;
      }
code_tokens: public function roleId ( array $ values ) { $ count = count ( $ values ) ; $ ids = array_filter ( $ values , 'ctype_digit' ) ; if ( $ count != count ( $ ids ) ) { return $ this -> translation -> text ( '@field has invalid value' , array ( '@field' => $ this -> translation -> text ( 'Condition' ) ) ) ; } $ exists = array_filter ( $ values , function ( $ role_id ) { if ( $ role_id == 0 ) { return true ; } $ role = $ this -> role -> get ( $ role_id ) ; return isset ( $ role [ 'role_id' ] ) ; } ) ; if ( $ count != count ( $ exists ) ) { return $ this -> translation -> text ( '@name is unavailable' , array ( '@name' => $ this -> translation -> text ( 'Role' ) ) ) ; } return true ; }
docstring: Validates the role ID condition
  @param array $values
  @return boolean|string
docstring_tokens: Validates the role ID condition