original_string: public function convertFromTypeDefinition(TypeDefinitionInterface $typeDefinition)
      {
          $propertyList = [
              'baseTypeId' => JSONConstants::JSON_TYPE_BASE_ID,
              'parentTypeId' => JSONConstants::JSON_TYPE_PARENT_ID
          ];
  
          if ($typeDefinition instanceof RelationshipTypeDefinitionInterface) {
              $propertyList['allowedTargetTypeIds'] = JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES;
              $propertyList['allowedSourceTypeIds'] = JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES;
          }
  
          $data = $typeDefinition->exportGettableProperties(
              $propertyList
          );
          $data = $this->castArrayValuesToSimpleTypes($data);
  
          return json_encode($data, JSON_FORCE_OBJECT);
      }
code: public function convertFromTypeDefinition(TypeDefinitionInterface $typeDefinition)
      {
          $propertyList = [
              'baseTypeId' => JSONConstants::JSON_TYPE_BASE_ID,
              'parentTypeId' => JSONConstants::JSON_TYPE_PARENT_ID
          ];
  
          if ($typeDefinition instanceof RelationshipTypeDefinitionInterface) {
              $propertyList['allowedTargetTypeIds'] = JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES;
              $propertyList['allowedSourceTypeIds'] = JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES;
          }
  
          $data = $typeDefinition->exportGettableProperties(
              $propertyList
          );
          $data = $this->castArrayValuesToSimpleTypes($data);
  
          return json_encode($data, JSON_FORCE_OBJECT);
      }
code_tokens: public function convertFromTypeDefinition ( TypeDefinitionInterface $ typeDefinition ) { $ propertyList = [ 'baseTypeId' => JSONConstants :: JSON_TYPE_BASE_ID , 'parentTypeId' => JSONConstants :: JSON_TYPE_PARENT_ID ] ; if ( $ typeDefinition instanceof RelationshipTypeDefinitionInterface ) { $ propertyList [ 'allowedTargetTypeIds' ] = JSONConstants :: JSON_TYPE_ALLOWED_TARGET_TYPES ; $ propertyList [ 'allowedSourceTypeIds' ] = JSONConstants :: JSON_TYPE_ALLOWED_SOURCE_TYPES ; } $ data = $ typeDefinition -> exportGettableProperties ( $ propertyList ) ; $ data = $ this -> castArrayValuesToSimpleTypes ( $ data ) ; return json_encode ( $ data , JSON_FORCE_OBJECT ) ; }
docstring: Convert a type definition object to a custom format
  
  @param TypeDefinitionInterface $typeDefinition
  @return string JSON representation of the type definition
docstring_tokens: Convert a type definition object to a custom format