original_string: protected function convertProperty(
          ObjectTypeInterface $objectType,
          array $secondaryTypes,
          PropertyDataInterface $propertyData
      ) {
          $definition = $objectType->getPropertyDefinition($propertyData->getId());
  
          // search secondary types
          if ($definition === null && !empty($secondaryTypes)) {
              foreach ($secondaryTypes as $secondaryType) {
                  $propertyDefinitions = $secondaryType->getPropertyDefinitions();
                  if (!empty($propertyDefinitions)) {
                      $definition = $secondaryType->getPropertyDefinition($propertyData->getId());
                      if ($definition !== null) {
                          break;
                      }
                  }
              }
          }
  
          // the type might have changed -> reload type definitions
          if ($definition === null) {
              $reloadedObjectType = $this->session->getTypeDefinition($objectType->getId(), false);
              $definition = $reloadedObjectType->getPropertyDefinition($propertyData->getId());
  
              if ($definition === null && !empty($secondaryTypes)) {
                  foreach ($secondaryTypes as $secondaryType) {
                      $reloadedSecondaryType = $this->session->getTypeDefinition($secondaryType->getId(), false);
                      $propertyDefinitions = $reloadedSecondaryType->getPropertyDefinitions();
                      if (!empty($propertyDefinitions)) {
                          $definition = $reloadedSecondaryType->getPropertyDefinition($propertyData->getId());
                          if ($definition !== null) {
                              break;
                          }
                      }
                  }
              }
          }
  
          if ($definition === null) {
              // property without definition
              throw new CmisRuntimeException(sprintf('Property "%s" doesn\'t exist!', $propertyData->getId()));
          }
  
          return $this->createProperty($definition, $propertyData->getValues());
      }
code: protected function convertProperty(
          ObjectTypeInterface $objectType,
          array $secondaryTypes,
          PropertyDataInterface $propertyData
      ) {
          $definition = $objectType->getPropertyDefinition($propertyData->getId());
  
          // search secondary types
          if ($definition === null && !empty($secondaryTypes)) {
              foreach ($secondaryTypes as $secondaryType) {
                  $propertyDefinitions = $secondaryType->getPropertyDefinitions();
                  if (!empty($propertyDefinitions)) {
                      $definition = $secondaryType->getPropertyDefinition($propertyData->getId());
                      if ($definition !== null) {
                          break;
                      }
                  }
              }
          }
  
          // the type might have changed -> reload type definitions
          if ($definition === null) {
              $reloadedObjectType = $this->session->getTypeDefinition($objectType->getId(), false);
              $definition = $reloadedObjectType->getPropertyDefinition($propertyData->getId());
  
              if ($definition === null && !empty($secondaryTypes)) {
                  foreach ($secondaryTypes as $secondaryType) {
                      $reloadedSecondaryType = $this->session->getTypeDefinition($secondaryType->getId(), false);
                      $propertyDefinitions = $reloadedSecondaryType->getPropertyDefinitions();
                      if (!empty($propertyDefinitions)) {
                          $definition = $reloadedSecondaryType->getPropertyDefinition($propertyData->getId());
                          if ($definition !== null) {
                              break;
                          }
                      }
                  }
              }
          }
  
          if ($definition === null) {
              // property without definition
              throw new CmisRuntimeException(sprintf('Property "%s" doesn\'t exist!', $propertyData->getId()));
          }
  
          return $this->createProperty($definition, $propertyData->getValues());
      }
code_tokens: protected function convertProperty ( ObjectTypeInterface $ objectType , array $ secondaryTypes , PropertyDataInterface $ propertyData ) { $ definition = $ objectType -> getPropertyDefinition ( $ propertyData -> getId ( ) ) ; // search secondary types if ( $ definition === null && ! empty ( $ secondaryTypes ) ) { foreach ( $ secondaryTypes as $ secondaryType ) { $ propertyDefinitions = $ secondaryType -> getPropertyDefinitions ( ) ; if ( ! empty ( $ propertyDefinitions ) ) { $ definition = $ secondaryType -> getPropertyDefinition ( $ propertyData -> getId ( ) ) ; if ( $ definition !== null ) { break ; } } } } // the type might have changed -> reload type definitions if ( $ definition === null ) { $ reloadedObjectType = $ this -> session -> getTypeDefinition ( $ objectType -> getId ( ) , false ) ; $ definition = $ reloadedObjectType -> getPropertyDefinition ( $ propertyData -> getId ( ) ) ; if ( $ definition === null && ! empty ( $ secondaryTypes ) ) { foreach ( $ secondaryTypes as $ secondaryType ) { $ reloadedSecondaryType = $ this -> session -> getTypeDefinition ( $ secondaryType -> getId ( ) , false ) ; $ propertyDefinitions = $ reloadedSecondaryType -> getPropertyDefinitions ( ) ; if ( ! empty ( $ propertyDefinitions ) ) { $ definition = $ reloadedSecondaryType -> getPropertyDefinition ( $ propertyData -> getId ( ) ) ; if ( $ definition !== null ) { break ; } } } } } if ( $ definition === null ) { // property without definition throw new CmisRuntimeException ( sprintf ( 'Property "%s" doesn\'t exist!' , $ propertyData -> getId ( ) ) ) ; } return $ this -> createProperty ( $ definition , $ propertyData -> getValues ( ) ) ; }
docstring: Convert PropertyData into a property API object
  
  @param ObjectTypeInterface $objectType
  @param SecondaryTypeInterface[] $secondaryTypes
  @param PropertyDataInterface $propertyData
  @return PropertyInterface
  @throws CmisRuntimeException
docstring_tokens: Convert PropertyData into a property API object