- Verification of invalid external fields (i.e fields pointing to a non-existing field in the target class).

SVN:trunk[392]
This commit is contained in:
Denis Flaven
2010-05-03 19:49:49 +00:00
parent cb9331c414
commit 029857b5f2

View File

@@ -1239,6 +1239,7 @@ class AttributeExternalField extends AttributeDefinition
{
$oKeyAttDef = $this->GetKeyAttDef();
$oExtAttDef = MetaModel::GetAttributeDef($oKeyAttDef->Get("targetclass"), $this->Get("target_attcode"));
if (!is_object($oExtAttDef)) throw new CoreException("Invalid external field ".$this->GetCode()." in class ".$this->GetHostClass().". The class ".$oKeyAttDef->Get("targetclass")." has no attribute ".$this->Get("target_attcode"));
return $oExtAttDef;
}