public function getQueryClass($name = null)
{
$objectKey = $this->getPhpName($name);
$clazz = $objectKey . 'Query';
if (!class_exists($clazz)) {
throw new ObjectNotFoundException(sprintf('The object query %s of %s does not exist.', $clazz, $objectKey));
}
return new $clazz();
}