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);
        }
    }
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);
        }
    }
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 ) ; } }
Convert given ObjectData to a high level API object

@param ObjectDataInterface $objectData
@param OperationContextInterface $context
@return CmisObjectInterface
@throws CmisRuntimeException
Convert given ObjectData to a high level API object