protected function getQueryNameAndAliasForType($typeDefinitionMixed, $autoAlias)
    {
        $alias = null;
        if (is_array($typeDefinitionMixed)) {
            list ($typeDefinitionMixed, $alias) = $typeDefinitionMixed;
        }
        if ($typeDefinitionMixed instanceof TypeDefinitionInterface) {
            $queryName = $typeDefinitionMixed->getQueryName();
        } elseif (is_string($typeDefinitionMixed) && strpos($typeDefinitionMixed, ' ')) {
            list ($typeDefinitionMixed, $alias) = explode(' ', $typeDefinitionMixed, 2);
        }
        try {
            $queryName = $this->session->getTypeDefinition($typeDefinitionMixed)->getQueryName();
        } catch (CmisObjectNotFoundException $error) {
            $queryName = $typeDefinitionMixed;
        }
        return [$queryName, ($alias ? $alias : $autoAlias)];
    }