original_string: private function deriveIdAction($actionName, $actionType)
      {
          switch ($actionType) {
              case 'url':
                  $originalActionName = $actionName;
                  $actionName = Common::unsanitizeInputValue($actionName);
                  $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_url', SegmentExpression::MATCH_EQUAL, 'pageUrl');
  
                  if ($id < 0) {
                      // an example where this is needed is urls containing < or >
                      $actionName = $originalActionName;
                      $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_url', SegmentExpression::MATCH_EQUAL, 'pageUrl');
                  }
  
                  return $id;
  
              case 'title':
                  $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle');
  
                  if ($id < 0) {
                      $unknown = ArchivingHelper::getUnknownActionName(Action::TYPE_PAGE_TITLE);
                      if (trim($actionName) == trim($unknown)) {
                          $id = TableLogAction::getIdActionFromSegment('', 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle');
                      }
                  }
  
                  return $id;
  
              default:
                  throw new Exception('Unknown action type');
          }
      }
code: private function deriveIdAction($actionName, $actionType)
      {
          switch ($actionType) {
              case 'url':
                  $originalActionName = $actionName;
                  $actionName = Common::unsanitizeInputValue($actionName);
                  $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_url', SegmentExpression::MATCH_EQUAL, 'pageUrl');
  
                  if ($id < 0) {
                      // an example where this is needed is urls containing < or >
                      $actionName = $originalActionName;
                      $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_url', SegmentExpression::MATCH_EQUAL, 'pageUrl');
                  }
  
                  return $id;
  
              case 'title':
                  $id = TableLogAction::getIdActionFromSegment($actionName, 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle');
  
                  if ($id < 0) {
                      $unknown = ArchivingHelper::getUnknownActionName(Action::TYPE_PAGE_TITLE);
                      if (trim($actionName) == trim($unknown)) {
                          $id = TableLogAction::getIdActionFromSegment('', 'idaction_name', SegmentExpression::MATCH_EQUAL, 'pageTitle');
                      }
                  }
  
                  return $id;
  
              default:
                  throw new Exception('Unknown action type');
          }
      }
code_tokens: private function deriveIdAction ( $ actionName , $ actionType ) { switch ( $ actionType ) { case 'url' : $ originalActionName = $ actionName ; $ actionName = Common :: unsanitizeInputValue ( $ actionName ) ; $ id = TableLogAction :: getIdActionFromSegment ( $ actionName , 'idaction_url' , SegmentExpression :: MATCH_EQUAL , 'pageUrl' ) ; if ( $ id < 0 ) { // an example where this is needed is urls containing < or > $ actionName = $ originalActionName ; $ id = TableLogAction :: getIdActionFromSegment ( $ actionName , 'idaction_url' , SegmentExpression :: MATCH_EQUAL , 'pageUrl' ) ; } return $ id ; case 'title' : $ id = TableLogAction :: getIdActionFromSegment ( $ actionName , 'idaction_name' , SegmentExpression :: MATCH_EQUAL , 'pageTitle' ) ; if ( $ id < 0 ) { $ unknown = ArchivingHelper :: getUnknownActionName ( Action :: TYPE_PAGE_TITLE ) ; if ( trim ( $ actionName ) == trim ( $ unknown ) ) { $ id = TableLogAction :: getIdActionFromSegment ( '' , 'idaction_name' , SegmentExpression :: MATCH_EQUAL , 'pageTitle' ) ; } } return $ id ; default : throw new Exception ( 'Unknown action type' ) ; } }
docstring: Derive the action ID from the request action name and type.
docstring_tokens: Derive the action ID from the request action name and type .