original_string: private function validateObjectAttribute( $contentObjectAttribute, $idString, $keywordString, $parentString, $localeString )
      {
          $classAttribute = $contentObjectAttribute->contentClassAttribute();
  
          // we cannot use empty() here as there can be cases where $parentString or $idString can be "0",
          // which evaluates to false with empty(), which is wrong for our use case
          if ( strlen( $keywordString ) == 0 && strlen( $parentString ) == 0 && strlen( $idString ) == 0 && strlen( $localeString ) == 0 )
          {
              if ( $contentObjectAttribute->validateIsRequired() )
              {
                  $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/eztags/datatypes', 'At least one tag is required to be added.' ) );
                  return eZInputValidator::STATE_INVALID;
              }
          }
          // see comment above
          else if ( strlen( $keywordString ) == 0 || strlen( $parentString ) == 0 || strlen( $idString ) == 0 || strlen( $localeString ) == 0 )
          {
              $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/eztags/datatypes', 'Attribute contains invalid data.' ) );
              return eZInputValidator::STATE_INVALID;
          }
          else
          {
              $idArray = explode( '|#', $idString );
              $keywordArray = explode( '|#', $keywordString );
              $parentArray = explode( '|#', $parentString );
              $localeArray = explode( '|#', $localeString );
              if ( count( $keywordArray ) != count( $idArray ) || count( $parentArray ) != count( $idArray ) || count( $localeArray ) != count( $idArray ) )
              {
                  $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/eztags/datatypes', 'Attribute contains invalid data.' ) );
                  return eZInputValidator::STATE_INVALID;
              }
  
              $maxTags = (int) $classAttribute->attribute( self::MAX_TAGS_FIELD );
              if ( $maxTags > 0 && ( count( $idArray ) > $maxTags || count( $keywordArray ) > $maxTags || count( $parentArray ) > $maxTags || count( $localeArray ) > $maxTags ) )
              {
                  $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/eztags/datatypes', 'Up to %1 tags are allowed to be added.', null, array( '%1' => $maxTags ) ) );
                  return eZInputValidator::STATE_INVALID;
              }
          }
  
          return eZInputValidator::STATE_ACCEPTED;
      }
code: private function validateObjectAttribute( $contentObjectAttribute, $idString, $keywordString, $parentString, $localeString )
      {
          $classAttribute = $contentObjectAttribute->contentClassAttribute();
  
          // we cannot use empty() here as there can be cases where $parentString or $idString can be "0",
          // which evaluates to false with empty(), which is wrong for our use case
          if ( strlen( $keywordString ) == 0 && strlen( $parentString ) == 0 && strlen( $idString ) == 0 && strlen( $localeString ) == 0 )
          {
              if ( $contentObjectAttribute->validateIsRequired() )
              {
                  $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/eztags/datatypes', 'At least one tag is required to be added.' ) );
                  return eZInputValidator::STATE_INVALID;
              }
          }
          // see comment above
          else if ( strlen( $keywordString ) == 0 || strlen( $parentString ) == 0 || strlen( $idString ) == 0 || strlen( $localeString ) == 0 )
          {
              $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/eztags/datatypes', 'Attribute contains invalid data.' ) );
              return eZInputValidator::STATE_INVALID;
          }
          else
          {
              $idArray = explode( '|#', $idString );
              $keywordArray = explode( '|#', $keywordString );
              $parentArray = explode( '|#', $parentString );
              $localeArray = explode( '|#', $localeString );
              if ( count( $keywordArray ) != count( $idArray ) || count( $parentArray ) != count( $idArray ) || count( $localeArray ) != count( $idArray ) )
              {
                  $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/eztags/datatypes', 'Attribute contains invalid data.' ) );
                  return eZInputValidator::STATE_INVALID;
              }
  
              $maxTags = (int) $classAttribute->attribute( self::MAX_TAGS_FIELD );
              if ( $maxTags > 0 && ( count( $idArray ) > $maxTags || count( $keywordArray ) > $maxTags || count( $parentArray ) > $maxTags || count( $localeArray ) > $maxTags ) )
              {
                  $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/eztags/datatypes', 'Up to %1 tags are allowed to be added.', null, array( '%1' => $maxTags ) ) );
                  return eZInputValidator::STATE_INVALID;
              }
          }
  
          return eZInputValidator::STATE_ACCEPTED;
      }
code_tokens: private function validateObjectAttribute ( $ contentObjectAttribute , $ idString , $ keywordString , $ parentString , $ localeString ) { $ classAttribute = $ contentObjectAttribute -> contentClassAttribute ( ) ; // we cannot use empty() here as there can be cases where $parentString or $idString can be "0", // which evaluates to false with empty(), which is wrong for our use case if ( strlen ( $ keywordString ) == 0 && strlen ( $ parentString ) == 0 && strlen ( $ idString ) == 0 && strlen ( $ localeString ) == 0 ) { if ( $ contentObjectAttribute -> validateIsRequired ( ) ) { $ contentObjectAttribute -> setValidationError ( ezpI18n :: tr ( 'extension/eztags/datatypes' , 'At least one tag is required to be added.' ) ) ; return eZInputValidator :: STATE_INVALID ; } } // see comment above else if ( strlen ( $ keywordString ) == 0 || strlen ( $ parentString ) == 0 || strlen ( $ idString ) == 0 || strlen ( $ localeString ) == 0 ) { $ contentObjectAttribute -> setValidationError ( ezpI18n :: tr ( 'extension/eztags/datatypes' , 'Attribute contains invalid data.' ) ) ; return eZInputValidator :: STATE_INVALID ; } else { $ idArray = explode ( '|#' , $ idString ) ; $ keywordArray = explode ( '|#' , $ keywordString ) ; $ parentArray = explode ( '|#' , $ parentString ) ; $ localeArray = explode ( '|#' , $ localeString ) ; if ( count ( $ keywordArray ) != count ( $ idArray ) || count ( $ parentArray ) != count ( $ idArray ) || count ( $ localeArray ) != count ( $ idArray ) ) { $ contentObjectAttribute -> setValidationError ( ezpI18n :: tr ( 'extension/eztags/datatypes' , 'Attribute contains invalid data.' ) ) ; return eZInputValidator :: STATE_INVALID ; } $ maxTags = ( int ) $ classAttribute -> attribute ( self :: MAX_TAGS_FIELD ) ; if ( $ maxTags > 0 && ( count ( $ idArray ) > $ maxTags || count ( $ keywordArray ) > $ maxTags || count ( $ parentArray ) > $ maxTags || count ( $ localeArray ) > $ maxTags ) ) { $ contentObjectAttribute -> setValidationError ( ezpI18n :: tr ( 'extension/eztags/datatypes' , 'Up to %1 tags are allowed to be added.' , null , array ( '%1' => $ maxTags ) ) ) ; return eZInputValidator :: STATE_INVALID ; } } return eZInputValidator :: STATE_ACCEPTED ; }
docstring: Validates the data structure and returns true if it is valid for this datatype
  
  @param eZContentObjectAttribute $contentObjectAttribute
  @param string $idString
  @param string $keywordString
  @param string $parentString
  @param string $localeString
  
  @return bool
docstring_tokens: Validates the data structure and returns true if it is valid for this datatype