From 4c4ed14af5b22ee83b5a389a50b413e0e9b1e4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20Espi=C3=A9?= Date: Thu, 5 Oct 2017 10:13:14 +0000 Subject: [PATCH] =?UTF-8?q?N=C2=B01100=20-=20External=20field=20pointing?= =?UTF-8?q?=20to=20a=20magic=20attribute=20*=20A=20specific=20pass=20has?= =?UTF-8?q?=20been=20added=20in=20MetaModel::InitClasses()=20to=20generate?= =?UTF-8?q?=20the=20magic=20attributes=20before=20the=20external=20fields.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SVN:trunk[4968] --- core/metamodel.class.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 190a69863..4661bf3f1 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -1866,15 +1866,13 @@ abstract class MetaModel } } - // Prepare external fields and filters - // Add final class to external keys - // + // Add magic attributes to the classes foreach (self::GetClasses() as $sClass) { $sRootClass = self::$m_aRootClasses[$sClass]; // Create the friendly name attribute - $sFriendlyNameAttCode = 'friendlyname'; + $sFriendlyNameAttCode = 'friendlyname'; $oFriendlyName = new AttributeFriendlyName($sFriendlyNameAttCode); self::AddMagicAttribute($oFriendlyName, $sClass); @@ -1884,7 +1882,7 @@ abstract class MetaModel $oArchiveFlag = new AttributeArchiveFlag('archive_flag'); self::AddMagicAttribute($oArchiveFlag, $sClass); - $oArchiveDate = new AttributeArchiveDate('archive_date', array('magic' => true, "allowed_values"=>null, "sql"=>'archive_date', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())); + $oArchiveDate = new AttributeArchiveDate('archive_date', array('magic' => true, "allowed_values" => null, "sql" => 'archive_date', "default_value" => '', "is_null_allowed" => true, "depends_on" => array())); self::AddMagicAttribute($oArchiveDate, $sClass); } elseif (self::$m_aClassParams[$sClass]["archive"]) @@ -1918,6 +1916,13 @@ abstract class MetaModel self::$m_aAttribOrigins[$sClass]['obsolescence_date'] = $sRootClass; } } + } + + // Prepare external fields and filters + // Add final class to external keys + // Add magic attributes to external keys (finalclass, friendlyname, archive_flag, obsolescence_flag) + foreach (self::GetClasses() as $sClass) + { foreach (self::$m_aAttribDefs[$sClass] as $sAttCode => $oAttDef) { // Compute the filter codes