Data Exchange - Improved to allow the import of complex attributes like passwords and documents + few fixes

SVN:trunk[1106]
This commit is contained in:
Romain Quetiez
2011-03-02 14:38:12 +00:00
parent 33f1ec8bf3
commit cf8174d54e
9 changed files with 227 additions and 122 deletions

View File

@@ -1657,18 +1657,29 @@ abstract class MetaModel
}
return $aSubClasses;
}
public static function GetClasses($sCategory = '')
public static function GetClasses($sCategories = '', $bStrict = false)
{
if (array_key_exists($sCategory, self::$m_Category2Class))
$aCategories = explode(',', $sCategories);
$aClasses = array();
foreach($aCategories as $sCategory)
{
return self::$m_Category2Class[$sCategory];
}
$sCategory = trim($sCategory);
if (strlen($sCategory) == 0)
{
return array_keys(self::$m_aClassParams);
}
//if (count(self::$m_Category2Class) > 0)
//{
// throw new CoreException("unkown class category '$sCategory', expecting a value in {".implode(', ', array_keys(self::$m_Category2Class))."}");
//}
return array();
if (array_key_exists($sCategory, self::$m_Category2Class))
{
$aClasses = array_merge($aClasses, self::$m_Category2Class[$sCategory]);
}
elseif ($bStrict)
{
throw new CoreException("unkown class category '$sCategory', expecting a value in {".implode(', ', array_keys(self::$m_Category2Class))."}");
}
}
return array_unique($aClasses);
}
public static function HasTable($sClass)