original_string: public function convertObject(ObjectDataInterface $objectData, OperationContextInterface $context)
      {
          $type = $this->getTypeFromObjectData($objectData);
          if ($type === null) {
              throw new CmisRuntimeException('Could not get type from object data.');
          }
          $baseTypeId = $objectData->getBaseTypeId();
  
          if ($baseTypeId->equals(BaseTypeId::CMIS_DOCUMENT)) {
              return new Document($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_FOLDER)) {
              return new Folder($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_POLICY)) {
              return new Policy($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_RELATIONSHIP)) {
              return new Relationship($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_ITEM)) {
              return new Item($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_SECONDARY)) {
              throw new CmisRuntimeException('Secondary type is used as object type: ' . $baseTypeId);
          } else {
              throw new CmisRuntimeException('Unsupported base type: ' . $baseTypeId);
          }
      }
code: public function convertObject(ObjectDataInterface $objectData, OperationContextInterface $context)
      {
          $type = $this->getTypeFromObjectData($objectData);
          if ($type === null) {
              throw new CmisRuntimeException('Could not get type from object data.');
          }
          $baseTypeId = $objectData->getBaseTypeId();
  
          if ($baseTypeId->equals(BaseTypeId::CMIS_DOCUMENT)) {
              return new Document($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_FOLDER)) {
              return new Folder($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_POLICY)) {
              return new Policy($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_RELATIONSHIP)) {
              return new Relationship($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_ITEM)) {
              return new Item($this->session, $type, $context, $objectData);
          } elseif ($baseTypeId->equals(BaseTypeId::CMIS_SECONDARY)) {
              throw new CmisRuntimeException('Secondary type is used as object type: ' . $baseTypeId);
          } else {
              throw new CmisRuntimeException('Unsupported base type: ' . $baseTypeId);
          }
      }
code_tokens: public function convertObject ( ObjectDataInterface $ objectData , OperationContextInterface $ context ) { $ type = $ this -> getTypeFromObjectData ( $ objectData ) ; if ( $ type === null ) { throw new CmisRuntimeException ( 'Could not get type from object data.' ) ; } $ baseTypeId = $ objectData -> getBaseTypeId ( ) ; if ( $ baseTypeId -> equals ( BaseTypeId :: CMIS_DOCUMENT ) ) { return new Document ( $ this -> session , $ type , $ context , $ objectData ) ; } elseif ( $ baseTypeId -> equals ( BaseTypeId :: CMIS_FOLDER ) ) { return new Folder ( $ this -> session , $ type , $ context , $ objectData ) ; } elseif ( $ baseTypeId -> equals ( BaseTypeId :: CMIS_POLICY ) ) { return new Policy ( $ this -> session , $ type , $ context , $ objectData ) ; } elseif ( $ baseTypeId -> equals ( BaseTypeId :: CMIS_RELATIONSHIP ) ) { return new Relationship ( $ this -> session , $ type , $ context , $ objectData ) ; } elseif ( $ baseTypeId -> equals ( BaseTypeId :: CMIS_ITEM ) ) { return new Item ( $ this -> session , $ type , $ context , $ objectData ) ; } elseif ( $ baseTypeId -> equals ( BaseTypeId :: CMIS_SECONDARY ) ) { throw new CmisRuntimeException ( 'Secondary type is used as object type: ' . $ baseTypeId ) ; } else { throw new CmisRuntimeException ( 'Unsupported base type: ' . $ baseTypeId ) ; } }
docstring: Convert given ObjectData to a high level API object
  
  @param ObjectDataInterface $objectData
  @param OperationContextInterface $context
  @return CmisObjectInterface
  @throws CmisRuntimeException
docstring_tokens: Convert given ObjectData to a high level API object