Do not rely on MetaModel::GetRootClass() to check the data model, use the abstraction of ModelReflection instead to keep the code portable.

SVN:trunk[3797]
This commit is contained in:
Denis Flaven
2015-10-08 15:54:23 +00:00
parent 9980d2e72a
commit 6dc190d369
3 changed files with 31 additions and 16 deletions

View File

@@ -580,13 +580,13 @@ class OqlUnionQuery extends OqlQuery
if ($iQuery == 0)
{
// Establish the reference
$sRootClass = MetaModel::GetRootClass($aData['class']);
$sRootClass = $oModelReflection->GetRootClass($aData['class']);
}
else
{
if (MetaModel::GetRootClass($aData['class']) != $sRootClass)
if ($oModelReflection->GetRootClass($aData['class']) != $sRootClass)
{
$aSubclasses = MetaModel::EnumChildClasses($sRootClass, ENUM_CHILD_CLASSES_ALL);
$aSubclasses = $oModelReflection->EnumChildClasses($sRootClass, ENUM_CHILD_CLASSES_ALL);
throw new OqlNormalizeException('Incompatible classes: could not find a common ancestor', $sSourceQuery, $aData['class_name'], $aSubclasses);
}
}