public function getTypeFromObjectData(ObjectDataInterface $objectData)
    {
        if ($objectData->getProperties() === null || count($objectData->getProperties()->getProperties()) === 0) {
            return null;
        }

        $typeProperty = $objectData->getProperties()->getProperties()[PropertyIds::OBJECT_TYPE_ID];

        if (!$typeProperty instanceof PropertyId) {
            return null;
        }

        return $this->session->getTypeDefinition($typeProperty->getFirstValue());
    }
public function getTypeFromObjectData(ObjectDataInterface $objectData)
    {
        if ($objectData->getProperties() === null || count($objectData->getProperties()->getProperties()) === 0) {
            return null;
        }

        $typeProperty = $objectData->getProperties()->getProperties()[PropertyIds::OBJECT_TYPE_ID];

        if (!$typeProperty instanceof PropertyId) {
            return null;
        }

        return $this->session->getTypeDefinition($typeProperty->getFirstValue());
    }
public function getTypeFromObjectData ( ObjectDataInterface $ objectData ) { if ( $ objectData -> getProperties ( ) === null || count ( $ objectData -> getProperties ( ) -> getProperties ( ) ) === 0 ) { return null ; } $ typeProperty = $ objectData -> getProperties ( ) -> getProperties ( ) [ PropertyIds :: OBJECT_TYPE_ID ] ; if ( ! $ typeProperty instanceof PropertyId ) { return null ; } return $ this -> session -> getTypeDefinition ( $ typeProperty -> getFirstValue ( ) ) ; }
Try to determined what object type the given objectData belongs to and return that type.

@param ObjectDataInterface $objectData
@return ObjectTypeInterface|null The object type or <code>null</code> if type could not be determined
Try to determined what object type the given objectData belongs to and return that type .